ovirtsdk4.writers
1# -*- coding: utf-8 -*- 2 3# 4# Copyright oVirt Authors 5# 6# Licensed under the Apache License, Version 2.0 (the "License"); 7# you may not use this file except in compliance with the License. 8# You may obtain a copy of the License at 9# 10# http://www.apache.org/licenses/LICENSE-2.0 11# 12# Unless required by applicable law or agreed to in writing, software 13# distributed under the License is distributed on an "AS IS" BASIS, 14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15# See the License for the specific language governing permissions and 16# limitations under the License. 17# 18 19 20from ovirtsdk4 import List 21from ovirtsdk4 import types 22from ovirtsdk4.writer import Writer 23 24 25class ActionWriter(Writer): 26 27 def __init__(self): 28 super(ActionWriter, self).__init__() 29 30 @staticmethod 31 def write_one(obj, writer, singular=None): 32 if singular is None: 33 singular = 'action' 34 writer.write_start(singular) 35 href = obj.href 36 if href is not None: 37 writer.write_attribute('href', href) 38 if obj.id is not None: 39 writer.write_attribute('id', obj.id) 40 if obj.activate is not None: 41 Writer.write_boolean(writer, 'activate', obj.activate) 42 if obj.allow_partial_import is not None: 43 Writer.write_boolean(writer, 'allow_partial_import', obj.allow_partial_import) 44 if obj.async_ is not None: 45 Writer.write_boolean(writer, 'async', obj.async_) 46 if obj.attach_wgt is not None: 47 Writer.write_boolean(writer, 'attach_wgt', obj.attach_wgt) 48 if obj.attachment is not None: 49 DiskAttachmentWriter.write_one(obj.attachment, writer, 'attachment') 50 if obj.authorized_key is not None: 51 AuthorizedKeyWriter.write_one(obj.authorized_key, writer, 'authorized_key') 52 if obj.auto_pinning_policy is not None: 53 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 54 if obj.bricks is not None: 55 GlusterBrickWriter.write_many(obj.bricks, writer, 'brick', 'bricks') 56 if obj.certificates is not None: 57 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 58 if obj.check_connectivity is not None: 59 Writer.write_boolean(writer, 'check_connectivity', obj.check_connectivity) 60 if obj.clone is not None: 61 Writer.write_boolean(writer, 'clone', obj.clone) 62 if obj.clone_permissions is not None: 63 Writer.write_boolean(writer, 'clone_permissions', obj.clone_permissions) 64 if obj.cluster is not None: 65 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 66 if obj.collapse_snapshots is not None: 67 Writer.write_boolean(writer, 'collapse_snapshots', obj.collapse_snapshots) 68 if obj.comment is not None: 69 Writer.write_string(writer, 'comment', obj.comment) 70 if obj.commit_on_success is not None: 71 Writer.write_boolean(writer, 'commit_on_success', obj.commit_on_success) 72 if obj.connection is not None: 73 StorageConnectionWriter.write_one(obj.connection, writer, 'connection') 74 if obj.connectivity_timeout is not None: 75 Writer.write_integer(writer, 'connectivity_timeout', obj.connectivity_timeout) 76 if obj.correlation_id is not None: 77 Writer.write_string(writer, 'correlation_id', obj.correlation_id) 78 if obj.data_center is not None: 79 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 80 if obj.deploy_hosted_engine is not None: 81 Writer.write_boolean(writer, 'deploy_hosted_engine', obj.deploy_hosted_engine) 82 if obj.description is not None: 83 Writer.write_string(writer, 'description', obj.description) 84 if obj.details is not None: 85 GlusterVolumeProfileDetailsWriter.write_one(obj.details, writer, 'details') 86 if obj.directory is not None: 87 Writer.write_string(writer, 'directory', obj.directory) 88 if obj.discard_snapshots is not None: 89 Writer.write_boolean(writer, 'discard_snapshots', obj.discard_snapshots) 90 if obj.discovered_targets is not None: 91 IscsiDetailsWriter.write_many(obj.discovered_targets, writer, 'iscsi_details', 'discovered_targets') 92 if obj.disk is not None: 93 DiskWriter.write_one(obj.disk, writer, 'disk') 94 if obj.disk_profile is not None: 95 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 96 if obj.disks is not None: 97 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 98 if obj.exclusive is not None: 99 Writer.write_boolean(writer, 'exclusive', obj.exclusive) 100 if obj.fault is not None: 101 FaultWriter.write_one(obj.fault, writer, 'fault') 102 if obj.fence_type is not None: 103 Writer.write_string(writer, 'fence_type', obj.fence_type) 104 if obj.filename is not None: 105 Writer.write_string(writer, 'filename', obj.filename) 106 if obj.filter is not None: 107 Writer.write_boolean(writer, 'filter', obj.filter) 108 if obj.fix_layout is not None: 109 Writer.write_boolean(writer, 'fix_layout', obj.fix_layout) 110 if obj.follow is not None: 111 Writer.write_string(writer, 'follow', obj.follow) 112 if obj.force is not None: 113 Writer.write_boolean(writer, 'force', obj.force) 114 if obj.grace_period is not None: 115 GracePeriodWriter.write_one(obj.grace_period, writer, 'grace_period') 116 if obj.host is not None: 117 HostWriter.write_one(obj.host, writer, 'host') 118 if obj.image is not None: 119 Writer.write_string(writer, 'image', obj.image) 120 if obj.image_transfer is not None: 121 ImageTransferWriter.write_one(obj.image_transfer, writer, 'image_transfer') 122 if obj.import_as_template is not None: 123 Writer.write_boolean(writer, 'import_as_template', obj.import_as_template) 124 if obj.is_attached is not None: 125 Writer.write_boolean(writer, 'is_attached', obj.is_attached) 126 if obj.iscsi is not None: 127 IscsiDetailsWriter.write_one(obj.iscsi, writer, 'iscsi') 128 if obj.iscsi_targets is not None: 129 writer.write_start('iscsi_targets') 130 for item in obj.iscsi_targets: 131 if item is not None: 132 Writer.write_string(writer, 'iscsi_target', item) 133 writer.write_end() 134 if obj.job is not None: 135 JobWriter.write_one(obj.job, writer, 'job') 136 if obj.lease is not None: 137 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 138 if obj.logical_units is not None: 139 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 140 if obj.maintenance_after_restart is not None: 141 Writer.write_boolean(writer, 'maintenance_after_restart', obj.maintenance_after_restart) 142 if obj.maintenance_enabled is not None: 143 Writer.write_boolean(writer, 'maintenance_enabled', obj.maintenance_enabled) 144 if obj.migrate_vms_in_affinity_closure is not None: 145 Writer.write_boolean(writer, 'migrate_vms_in_affinity_closure', obj.migrate_vms_in_affinity_closure) 146 if obj.modified_bonds is not None: 147 HostNicWriter.write_many(obj.modified_bonds, writer, 'host_nic', 'modified_bonds') 148 if obj.modified_labels is not None: 149 NetworkLabelWriter.write_many(obj.modified_labels, writer, 'network_label', 'modified_labels') 150 if obj.modified_network_attachments is not None: 151 NetworkAttachmentWriter.write_many(obj.modified_network_attachments, writer, 'network_attachment', 'modified_network_attachments') 152 if obj.name is not None: 153 Writer.write_string(writer, 'name', obj.name) 154 if obj.optimize_cpu_settings is not None: 155 Writer.write_boolean(writer, 'optimize_cpu_settings', obj.optimize_cpu_settings) 156 if obj.option is not None: 157 OptionWriter.write_one(obj.option, writer, 'option') 158 if obj.pause is not None: 159 Writer.write_boolean(writer, 'pause', obj.pause) 160 if obj.permission is not None: 161 PermissionWriter.write_one(obj.permission, writer, 'permission') 162 if obj.power_management is not None: 163 PowerManagementWriter.write_one(obj.power_management, writer, 'power_management') 164 if obj.proxy_ticket is not None: 165 ProxyTicketWriter.write_one(obj.proxy_ticket, writer, 'proxy_ticket') 166 if obj.quota is not None: 167 QuotaWriter.write_one(obj.quota, writer, 'quota') 168 if obj.reason is not None: 169 Writer.write_string(writer, 'reason', obj.reason) 170 if obj.reassign_bad_macs is not None: 171 Writer.write_boolean(writer, 'reassign_bad_macs', obj.reassign_bad_macs) 172 if obj.reboot is not None: 173 Writer.write_boolean(writer, 'reboot', obj.reboot) 174 if obj.registration_configuration is not None: 175 RegistrationConfigurationWriter.write_one(obj.registration_configuration, writer, 'registration_configuration') 176 if obj.remote_viewer_connection_file is not None: 177 Writer.write_string(writer, 'remote_viewer_connection_file', obj.remote_viewer_connection_file) 178 if obj.removed_bonds is not None: 179 HostNicWriter.write_many(obj.removed_bonds, writer, 'host_nic', 'removed_bonds') 180 if obj.removed_labels is not None: 181 NetworkLabelWriter.write_many(obj.removed_labels, writer, 'network_label', 'removed_labels') 182 if obj.removed_network_attachments is not None: 183 NetworkAttachmentWriter.write_many(obj.removed_network_attachments, writer, 'network_attachment', 'removed_network_attachments') 184 if obj.resolution_type is not None: 185 Writer.write_string(writer, 'resolution_type', obj.resolution_type) 186 if obj.restore_memory is not None: 187 Writer.write_boolean(writer, 'restore_memory', obj.restore_memory) 188 if obj.root_password is not None: 189 Writer.write_string(writer, 'root_password', obj.root_password) 190 if obj.seal is not None: 191 Writer.write_boolean(writer, 'seal', obj.seal) 192 if obj.snapshot is not None: 193 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 194 if obj.source_host is not None: 195 HostWriter.write_one(obj.source_host, writer, 'source_host') 196 if obj.ssh is not None: 197 SshWriter.write_one(obj.ssh, writer, 'ssh') 198 if obj.status is not None: 199 Writer.write_string(writer, 'status', obj.status) 200 if obj.stop_gluster_service is not None: 201 Writer.write_boolean(writer, 'stop_gluster_service', obj.stop_gluster_service) 202 if obj.storage_domain is not None: 203 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 204 if obj.storage_domains is not None: 205 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 206 if obj.succeeded is not None: 207 Writer.write_boolean(writer, 'succeeded', obj.succeeded) 208 if obj.synchronized_network_attachments is not None: 209 NetworkAttachmentWriter.write_many(obj.synchronized_network_attachments, writer, 'network_attachment', 'synchronized_network_attachments') 210 if obj.template is not None: 211 TemplateWriter.write_one(obj.template, writer, 'template') 212 if obj.ticket is not None: 213 TicketWriter.write_one(obj.ticket, writer, 'ticket') 214 if obj.timeout is not None: 215 Writer.write_integer(writer, 'timeout', obj.timeout) 216 if obj.undeploy_hosted_engine is not None: 217 Writer.write_boolean(writer, 'undeploy_hosted_engine', obj.undeploy_hosted_engine) 218 if obj.upgrade_action is not None: 219 Writer.write_string(writer, 'upgrade_action', obj.upgrade_action.value) 220 if obj.upgrade_percent_complete is not None: 221 Writer.write_integer(writer, 'upgrade_percent_complete', obj.upgrade_percent_complete) 222 if obj.use_cloud_init is not None: 223 Writer.write_boolean(writer, 'use_cloud_init', obj.use_cloud_init) 224 if obj.use_ignition is not None: 225 Writer.write_boolean(writer, 'use_ignition', obj.use_ignition) 226 if obj.use_initialization is not None: 227 Writer.write_boolean(writer, 'use_initialization', obj.use_initialization) 228 if obj.use_sysprep is not None: 229 Writer.write_boolean(writer, 'use_sysprep', obj.use_sysprep) 230 if obj.virtual_functions_configuration is not None: 231 HostNicVirtualFunctionsConfigurationWriter.write_one(obj.virtual_functions_configuration, writer, 'virtual_functions_configuration') 232 if obj.vm is not None: 233 VmWriter.write_one(obj.vm, writer, 'vm') 234 if obj.vnic_profile_mappings is not None: 235 VnicProfileMappingWriter.write_many(obj.vnic_profile_mappings, writer, 'vnic_profile_mapping', 'vnic_profile_mappings') 236 if obj.volatile is not None: 237 Writer.write_boolean(writer, 'volatile', obj.volatile) 238 writer.write_end() 239 240 @staticmethod 241 def write_many(objs, writer, singular=None, plural=None): 242 if singular is None: 243 singular = 'action' 244 if plural is None: 245 plural = 'actions' 246 writer.write_start(plural) 247 if isinstance(objs, List): 248 href = objs.href 249 if href is not None: 250 writer.write_attribute('href', href) 251 for obj in objs: 252 ActionWriter.write_one(obj, writer, singular) 253 writer.write_end() 254 255 256class AffinityGroupWriter(Writer): 257 258 def __init__(self): 259 super(AffinityGroupWriter, self).__init__() 260 261 @staticmethod 262 def write_one(obj, writer, singular=None): 263 if singular is None: 264 singular = 'affinity_group' 265 writer.write_start(singular) 266 href = obj.href 267 if href is not None: 268 writer.write_attribute('href', href) 269 if obj.id is not None: 270 writer.write_attribute('id', obj.id) 271 if obj.broken is not None: 272 Writer.write_boolean(writer, 'broken', obj.broken) 273 if obj.comment is not None: 274 Writer.write_string(writer, 'comment', obj.comment) 275 if obj.description is not None: 276 Writer.write_string(writer, 'description', obj.description) 277 if obj.enforcing is not None: 278 Writer.write_boolean(writer, 'enforcing', obj.enforcing) 279 if obj.hosts_rule is not None: 280 AffinityRuleWriter.write_one(obj.hosts_rule, writer, 'hosts_rule') 281 if obj.name is not None: 282 Writer.write_string(writer, 'name', obj.name) 283 if obj.positive is not None: 284 Writer.write_boolean(writer, 'positive', obj.positive) 285 if obj.priority is not None: 286 Writer.write_decimal(writer, 'priority', obj.priority) 287 if obj.vms_rule is not None: 288 AffinityRuleWriter.write_one(obj.vms_rule, writer, 'vms_rule') 289 if obj.cluster is not None: 290 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 291 if obj.host_labels is not None: 292 AffinityLabelWriter.write_many(obj.host_labels, writer, 'affinity_label', 'host_labels') 293 if obj.hosts is not None: 294 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 295 if obj.vm_labels is not None: 296 AffinityLabelWriter.write_many(obj.vm_labels, writer, 'affinity_label', 'vm_labels') 297 if obj.vms is not None: 298 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 299 writer.write_end() 300 301 @staticmethod 302 def write_many(objs, writer, singular=None, plural=None): 303 if singular is None: 304 singular = 'affinity_group' 305 if plural is None: 306 plural = 'affinity_groups' 307 writer.write_start(plural) 308 if isinstance(objs, List): 309 href = objs.href 310 if href is not None: 311 writer.write_attribute('href', href) 312 for obj in objs: 313 AffinityGroupWriter.write_one(obj, writer, singular) 314 writer.write_end() 315 316 317class AffinityLabelWriter(Writer): 318 319 def __init__(self): 320 super(AffinityLabelWriter, self).__init__() 321 322 @staticmethod 323 def write_one(obj, writer, singular=None): 324 if singular is None: 325 singular = 'affinity_label' 326 writer.write_start(singular) 327 href = obj.href 328 if href is not None: 329 writer.write_attribute('href', href) 330 if obj.id is not None: 331 writer.write_attribute('id', obj.id) 332 if obj.comment is not None: 333 Writer.write_string(writer, 'comment', obj.comment) 334 if obj.description is not None: 335 Writer.write_string(writer, 'description', obj.description) 336 if obj.has_implicit_affinity_group is not None: 337 Writer.write_boolean(writer, 'has_implicit_affinity_group', obj.has_implicit_affinity_group) 338 if obj.name is not None: 339 Writer.write_string(writer, 'name', obj.name) 340 if obj.read_only is not None: 341 Writer.write_boolean(writer, 'read_only', obj.read_only) 342 if obj.hosts is not None: 343 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 344 if obj.vms is not None: 345 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 346 writer.write_end() 347 348 @staticmethod 349 def write_many(objs, writer, singular=None, plural=None): 350 if singular is None: 351 singular = 'affinity_label' 352 if plural is None: 353 plural = 'affinity_labels' 354 writer.write_start(plural) 355 if isinstance(objs, List): 356 href = objs.href 357 if href is not None: 358 writer.write_attribute('href', href) 359 for obj in objs: 360 AffinityLabelWriter.write_one(obj, writer, singular) 361 writer.write_end() 362 363 364class AffinityRuleWriter(Writer): 365 366 def __init__(self): 367 super(AffinityRuleWriter, self).__init__() 368 369 @staticmethod 370 def write_one(obj, writer, singular=None): 371 if singular is None: 372 singular = 'affinity_rule' 373 writer.write_start(singular) 374 href = obj.href 375 if href is not None: 376 writer.write_attribute('href', href) 377 if obj.enabled is not None: 378 Writer.write_boolean(writer, 'enabled', obj.enabled) 379 if obj.enforcing is not None: 380 Writer.write_boolean(writer, 'enforcing', obj.enforcing) 381 if obj.positive is not None: 382 Writer.write_boolean(writer, 'positive', obj.positive) 383 writer.write_end() 384 385 @staticmethod 386 def write_many(objs, writer, singular=None, plural=None): 387 if singular is None: 388 singular = 'affinity_rule' 389 if plural is None: 390 plural = 'affinity_rules' 391 writer.write_start(plural) 392 if isinstance(objs, List): 393 href = objs.href 394 if href is not None: 395 writer.write_attribute('href', href) 396 for obj in objs: 397 AffinityRuleWriter.write_one(obj, writer, singular) 398 writer.write_end() 399 400 401class AgentWriter(Writer): 402 403 def __init__(self): 404 super(AgentWriter, self).__init__() 405 406 @staticmethod 407 def write_one(obj, writer, singular=None): 408 if singular is None: 409 singular = 'agent' 410 writer.write_start(singular) 411 href = obj.href 412 if href is not None: 413 writer.write_attribute('href', href) 414 if obj.id is not None: 415 writer.write_attribute('id', obj.id) 416 if obj.address is not None: 417 Writer.write_string(writer, 'address', obj.address) 418 if obj.comment is not None: 419 Writer.write_string(writer, 'comment', obj.comment) 420 if obj.concurrent is not None: 421 Writer.write_boolean(writer, 'concurrent', obj.concurrent) 422 if obj.description is not None: 423 Writer.write_string(writer, 'description', obj.description) 424 if obj.encrypt_options is not None: 425 Writer.write_boolean(writer, 'encrypt_options', obj.encrypt_options) 426 if obj.name is not None: 427 Writer.write_string(writer, 'name', obj.name) 428 if obj.options is not None: 429 OptionWriter.write_many(obj.options, writer, 'option', 'options') 430 if obj.order is not None: 431 Writer.write_integer(writer, 'order', obj.order) 432 if obj.password is not None: 433 Writer.write_string(writer, 'password', obj.password) 434 if obj.port is not None: 435 Writer.write_integer(writer, 'port', obj.port) 436 if obj.type is not None: 437 Writer.write_string(writer, 'type', obj.type) 438 if obj.username is not None: 439 Writer.write_string(writer, 'username', obj.username) 440 if obj.host is not None: 441 HostWriter.write_one(obj.host, writer, 'host') 442 writer.write_end() 443 444 @staticmethod 445 def write_many(objs, writer, singular=None, plural=None): 446 if singular is None: 447 singular = 'agent' 448 if plural is None: 449 plural = 'agents' 450 writer.write_start(plural) 451 if isinstance(objs, List): 452 href = objs.href 453 if href is not None: 454 writer.write_attribute('href', href) 455 for obj in objs: 456 AgentWriter.write_one(obj, writer, singular) 457 writer.write_end() 458 459 460class AgentConfigurationWriter(Writer): 461 462 def __init__(self): 463 super(AgentConfigurationWriter, self).__init__() 464 465 @staticmethod 466 def write_one(obj, writer, singular=None): 467 if singular is None: 468 singular = 'agent_configuration' 469 writer.write_start(singular) 470 href = obj.href 471 if href is not None: 472 writer.write_attribute('href', href) 473 if obj.address is not None: 474 Writer.write_string(writer, 'address', obj.address) 475 if obj.broker_type is not None: 476 Writer.write_string(writer, 'broker_type', obj.broker_type.value) 477 if obj.network_mappings is not None: 478 Writer.write_string(writer, 'network_mappings', obj.network_mappings) 479 if obj.password is not None: 480 Writer.write_string(writer, 'password', obj.password) 481 if obj.port is not None: 482 Writer.write_integer(writer, 'port', obj.port) 483 if obj.username is not None: 484 Writer.write_string(writer, 'username', obj.username) 485 writer.write_end() 486 487 @staticmethod 488 def write_many(objs, writer, singular=None, plural=None): 489 if singular is None: 490 singular = 'agent_configuration' 491 if plural is None: 492 plural = 'agent_configurations' 493 writer.write_start(plural) 494 if isinstance(objs, List): 495 href = objs.href 496 if href is not None: 497 writer.write_attribute('href', href) 498 for obj in objs: 499 AgentConfigurationWriter.write_one(obj, writer, singular) 500 writer.write_end() 501 502 503class ApiWriter(Writer): 504 505 def __init__(self): 506 super(ApiWriter, self).__init__() 507 508 @staticmethod 509 def write_one(obj, writer, singular=None): 510 if singular is None: 511 singular = 'api' 512 writer.write_start(singular) 513 href = obj.href 514 if href is not None: 515 writer.write_attribute('href', href) 516 if obj.engine_backup is not None: 517 EngineBackupInfoWriter.write_one(obj.engine_backup, writer, 'engine_backup') 518 if obj.product_info is not None: 519 ProductInfoWriter.write_one(obj.product_info, writer, 'product_info') 520 if obj.special_objects is not None: 521 SpecialObjectsWriter.write_one(obj.special_objects, writer, 'special_objects') 522 if obj.summary is not None: 523 ApiSummaryWriter.write_one(obj.summary, writer, 'summary') 524 if obj.time is not None: 525 Writer.write_date(writer, 'time', obj.time) 526 if obj.authenticated_user is not None: 527 UserWriter.write_one(obj.authenticated_user, writer, 'authenticated_user') 528 if obj.effective_user is not None: 529 UserWriter.write_one(obj.effective_user, writer, 'effective_user') 530 writer.write_end() 531 532 @staticmethod 533 def write_many(objs, writer, singular=None, plural=None): 534 if singular is None: 535 singular = 'api' 536 if plural is None: 537 plural = 'apis' 538 writer.write_start(plural) 539 if isinstance(objs, List): 540 href = objs.href 541 if href is not None: 542 writer.write_attribute('href', href) 543 for obj in objs: 544 ApiWriter.write_one(obj, writer, singular) 545 writer.write_end() 546 547 548class ApiSummaryWriter(Writer): 549 550 def __init__(self): 551 super(ApiSummaryWriter, self).__init__() 552 553 @staticmethod 554 def write_one(obj, writer, singular=None): 555 if singular is None: 556 singular = 'api_summary' 557 writer.write_start(singular) 558 href = obj.href 559 if href is not None: 560 writer.write_attribute('href', href) 561 if obj.hosts is not None: 562 ApiSummaryItemWriter.write_one(obj.hosts, writer, 'hosts') 563 if obj.storage_domains is not None: 564 ApiSummaryItemWriter.write_one(obj.storage_domains, writer, 'storage_domains') 565 if obj.users is not None: 566 ApiSummaryItemWriter.write_one(obj.users, writer, 'users') 567 if obj.vms is not None: 568 ApiSummaryItemWriter.write_one(obj.vms, writer, 'vms') 569 writer.write_end() 570 571 @staticmethod 572 def write_many(objs, writer, singular=None, plural=None): 573 if singular is None: 574 singular = 'api_summary' 575 if plural is None: 576 plural = 'api_summaries' 577 writer.write_start(plural) 578 if isinstance(objs, List): 579 href = objs.href 580 if href is not None: 581 writer.write_attribute('href', href) 582 for obj in objs: 583 ApiSummaryWriter.write_one(obj, writer, singular) 584 writer.write_end() 585 586 587class ApiSummaryItemWriter(Writer): 588 589 def __init__(self): 590 super(ApiSummaryItemWriter, self).__init__() 591 592 @staticmethod 593 def write_one(obj, writer, singular=None): 594 if singular is None: 595 singular = 'api_summary_item' 596 writer.write_start(singular) 597 href = obj.href 598 if href is not None: 599 writer.write_attribute('href', href) 600 if obj.active is not None: 601 Writer.write_integer(writer, 'active', obj.active) 602 if obj.total is not None: 603 Writer.write_integer(writer, 'total', obj.total) 604 writer.write_end() 605 606 @staticmethod 607 def write_many(objs, writer, singular=None, plural=None): 608 if singular is None: 609 singular = 'api_summary_item' 610 if plural is None: 611 plural = 'api_summary_items' 612 writer.write_start(plural) 613 if isinstance(objs, List): 614 href = objs.href 615 if href is not None: 616 writer.write_attribute('href', href) 617 for obj in objs: 618 ApiSummaryItemWriter.write_one(obj, writer, singular) 619 writer.write_end() 620 621 622class ApplicationWriter(Writer): 623 624 def __init__(self): 625 super(ApplicationWriter, self).__init__() 626 627 @staticmethod 628 def write_one(obj, writer, singular=None): 629 if singular is None: 630 singular = 'application' 631 writer.write_start(singular) 632 href = obj.href 633 if href is not None: 634 writer.write_attribute('href', href) 635 if obj.id is not None: 636 writer.write_attribute('id', obj.id) 637 if obj.comment is not None: 638 Writer.write_string(writer, 'comment', obj.comment) 639 if obj.description is not None: 640 Writer.write_string(writer, 'description', obj.description) 641 if obj.name is not None: 642 Writer.write_string(writer, 'name', obj.name) 643 if obj.vm is not None: 644 VmWriter.write_one(obj.vm, writer, 'vm') 645 writer.write_end() 646 647 @staticmethod 648 def write_many(objs, writer, singular=None, plural=None): 649 if singular is None: 650 singular = 'application' 651 if plural is None: 652 plural = 'applications' 653 writer.write_start(plural) 654 if isinstance(objs, List): 655 href = objs.href 656 if href is not None: 657 writer.write_attribute('href', href) 658 for obj in objs: 659 ApplicationWriter.write_one(obj, writer, singular) 660 writer.write_end() 661 662 663class AuthorizedKeyWriter(Writer): 664 665 def __init__(self): 666 super(AuthorizedKeyWriter, self).__init__() 667 668 @staticmethod 669 def write_one(obj, writer, singular=None): 670 if singular is None: 671 singular = 'authorized_key' 672 writer.write_start(singular) 673 href = obj.href 674 if href is not None: 675 writer.write_attribute('href', href) 676 if obj.id is not None: 677 writer.write_attribute('id', obj.id) 678 if obj.comment is not None: 679 Writer.write_string(writer, 'comment', obj.comment) 680 if obj.description is not None: 681 Writer.write_string(writer, 'description', obj.description) 682 if obj.key is not None: 683 Writer.write_string(writer, 'key', obj.key) 684 if obj.name is not None: 685 Writer.write_string(writer, 'name', obj.name) 686 if obj.user is not None: 687 UserWriter.write_one(obj.user, writer, 'user') 688 writer.write_end() 689 690 @staticmethod 691 def write_many(objs, writer, singular=None, plural=None): 692 if singular is None: 693 singular = 'authorized_key' 694 if plural is None: 695 plural = 'authorized_keys' 696 writer.write_start(plural) 697 if isinstance(objs, List): 698 href = objs.href 699 if href is not None: 700 writer.write_attribute('href', href) 701 for obj in objs: 702 AuthorizedKeyWriter.write_one(obj, writer, singular) 703 writer.write_end() 704 705 706class BackupWriter(Writer): 707 708 def __init__(self): 709 super(BackupWriter, self).__init__() 710 711 @staticmethod 712 def write_one(obj, writer, singular=None): 713 if singular is None: 714 singular = 'backup' 715 writer.write_start(singular) 716 href = obj.href 717 if href is not None: 718 writer.write_attribute('href', href) 719 if obj.id is not None: 720 writer.write_attribute('id', obj.id) 721 if obj.comment is not None: 722 Writer.write_string(writer, 'comment', obj.comment) 723 if obj.creation_date is not None: 724 Writer.write_date(writer, 'creation_date', obj.creation_date) 725 if obj.description is not None: 726 Writer.write_string(writer, 'description', obj.description) 727 if obj.from_checkpoint_id is not None: 728 Writer.write_string(writer, 'from_checkpoint_id', obj.from_checkpoint_id) 729 if obj.modification_date is not None: 730 Writer.write_date(writer, 'modification_date', obj.modification_date) 731 if obj.name is not None: 732 Writer.write_string(writer, 'name', obj.name) 733 if obj.phase is not None: 734 Writer.write_string(writer, 'phase', obj.phase.value) 735 if obj.to_checkpoint_id is not None: 736 Writer.write_string(writer, 'to_checkpoint_id', obj.to_checkpoint_id) 737 if obj.disks is not None: 738 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 739 if obj.host is not None: 740 HostWriter.write_one(obj.host, writer, 'host') 741 if obj.snapshot is not None: 742 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 743 if obj.vm is not None: 744 VmWriter.write_one(obj.vm, writer, 'vm') 745 writer.write_end() 746 747 @staticmethod 748 def write_many(objs, writer, singular=None, plural=None): 749 if singular is None: 750 singular = 'backup' 751 if plural is None: 752 plural = 'backups' 753 writer.write_start(plural) 754 if isinstance(objs, List): 755 href = objs.href 756 if href is not None: 757 writer.write_attribute('href', href) 758 for obj in objs: 759 BackupWriter.write_one(obj, writer, singular) 760 writer.write_end() 761 762 763class BalanceWriter(Writer): 764 765 def __init__(self): 766 super(BalanceWriter, self).__init__() 767 768 @staticmethod 769 def write_one(obj, writer, singular=None): 770 if singular is None: 771 singular = 'balance' 772 writer.write_start(singular) 773 href = obj.href 774 if href is not None: 775 writer.write_attribute('href', href) 776 if obj.id is not None: 777 writer.write_attribute('id', obj.id) 778 if obj.comment is not None: 779 Writer.write_string(writer, 'comment', obj.comment) 780 if obj.description is not None: 781 Writer.write_string(writer, 'description', obj.description) 782 if obj.name is not None: 783 Writer.write_string(writer, 'name', obj.name) 784 if obj.scheduling_policy is not None: 785 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 786 if obj.scheduling_policy_unit is not None: 787 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 788 writer.write_end() 789 790 @staticmethod 791 def write_many(objs, writer, singular=None, plural=None): 792 if singular is None: 793 singular = 'balance' 794 if plural is None: 795 plural = 'balances' 796 writer.write_start(plural) 797 if isinstance(objs, List): 798 href = objs.href 799 if href is not None: 800 writer.write_attribute('href', href) 801 for obj in objs: 802 BalanceWriter.write_one(obj, writer, singular) 803 writer.write_end() 804 805 806class BiosWriter(Writer): 807 808 def __init__(self): 809 super(BiosWriter, self).__init__() 810 811 @staticmethod 812 def write_one(obj, writer, singular=None): 813 if singular is None: 814 singular = 'bios' 815 writer.write_start(singular) 816 href = obj.href 817 if href is not None: 818 writer.write_attribute('href', href) 819 if obj.boot_menu is not None: 820 BootMenuWriter.write_one(obj.boot_menu, writer, 'boot_menu') 821 if obj.type is not None: 822 Writer.write_string(writer, 'type', obj.type.value) 823 writer.write_end() 824 825 @staticmethod 826 def write_many(objs, writer, singular=None, plural=None): 827 if singular is None: 828 singular = 'bios' 829 if plural is None: 830 plural = 'bioss' 831 writer.write_start(plural) 832 if isinstance(objs, List): 833 href = objs.href 834 if href is not None: 835 writer.write_attribute('href', href) 836 for obj in objs: 837 BiosWriter.write_one(obj, writer, singular) 838 writer.write_end() 839 840 841class BlockStatisticWriter(Writer): 842 843 def __init__(self): 844 super(BlockStatisticWriter, self).__init__() 845 846 @staticmethod 847 def write_one(obj, writer, singular=None): 848 if singular is None: 849 singular = 'block_statistic' 850 writer.write_start(singular) 851 href = obj.href 852 if href is not None: 853 writer.write_attribute('href', href) 854 if obj.statistics is not None: 855 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 856 writer.write_end() 857 858 @staticmethod 859 def write_many(objs, writer, singular=None, plural=None): 860 if singular is None: 861 singular = 'block_statistic' 862 if plural is None: 863 plural = 'block_statistics' 864 writer.write_start(plural) 865 if isinstance(objs, List): 866 href = objs.href 867 if href is not None: 868 writer.write_attribute('href', href) 869 for obj in objs: 870 BlockStatisticWriter.write_one(obj, writer, singular) 871 writer.write_end() 872 873 874class BondingWriter(Writer): 875 876 def __init__(self): 877 super(BondingWriter, self).__init__() 878 879 @staticmethod 880 def write_one(obj, writer, singular=None): 881 if singular is None: 882 singular = 'bonding' 883 writer.write_start(singular) 884 href = obj.href 885 if href is not None: 886 writer.write_attribute('href', href) 887 if obj.ad_partner_mac is not None: 888 MacWriter.write_one(obj.ad_partner_mac, writer, 'ad_partner_mac') 889 if obj.options is not None: 890 OptionWriter.write_many(obj.options, writer, 'option', 'options') 891 if obj.slaves is not None: 892 HostNicWriter.write_many(obj.slaves, writer, 'host_nic', 'slaves') 893 if obj.active_slave is not None: 894 HostNicWriter.write_one(obj.active_slave, writer, 'active_slave') 895 writer.write_end() 896 897 @staticmethod 898 def write_many(objs, writer, singular=None, plural=None): 899 if singular is None: 900 singular = 'bonding' 901 if plural is None: 902 plural = 'bondings' 903 writer.write_start(plural) 904 if isinstance(objs, List): 905 href = objs.href 906 if href is not None: 907 writer.write_attribute('href', href) 908 for obj in objs: 909 BondingWriter.write_one(obj, writer, singular) 910 writer.write_end() 911 912 913class BookmarkWriter(Writer): 914 915 def __init__(self): 916 super(BookmarkWriter, self).__init__() 917 918 @staticmethod 919 def write_one(obj, writer, singular=None): 920 if singular is None: 921 singular = 'bookmark' 922 writer.write_start(singular) 923 href = obj.href 924 if href is not None: 925 writer.write_attribute('href', href) 926 if obj.id is not None: 927 writer.write_attribute('id', obj.id) 928 if obj.comment is not None: 929 Writer.write_string(writer, 'comment', obj.comment) 930 if obj.description is not None: 931 Writer.write_string(writer, 'description', obj.description) 932 if obj.name is not None: 933 Writer.write_string(writer, 'name', obj.name) 934 if obj.value is not None: 935 Writer.write_string(writer, 'value', obj.value) 936 writer.write_end() 937 938 @staticmethod 939 def write_many(objs, writer, singular=None, plural=None): 940 if singular is None: 941 singular = 'bookmark' 942 if plural is None: 943 plural = 'bookmarks' 944 writer.write_start(plural) 945 if isinstance(objs, List): 946 href = objs.href 947 if href is not None: 948 writer.write_attribute('href', href) 949 for obj in objs: 950 BookmarkWriter.write_one(obj, writer, singular) 951 writer.write_end() 952 953 954class BootWriter(Writer): 955 956 def __init__(self): 957 super(BootWriter, self).__init__() 958 959 @staticmethod 960 def write_one(obj, writer, singular=None): 961 if singular is None: 962 singular = 'boot' 963 writer.write_start(singular) 964 href = obj.href 965 if href is not None: 966 writer.write_attribute('href', href) 967 if obj.devices is not None: 968 writer.write_start('devices') 969 for item in obj.devices: 970 if item is not None: 971 Writer.write_string(writer, 'device', item.value) 972 writer.write_end() 973 writer.write_end() 974 975 @staticmethod 976 def write_many(objs, writer, singular=None, plural=None): 977 if singular is None: 978 singular = 'boot' 979 if plural is None: 980 plural = 'boots' 981 writer.write_start(plural) 982 if isinstance(objs, List): 983 href = objs.href 984 if href is not None: 985 writer.write_attribute('href', href) 986 for obj in objs: 987 BootWriter.write_one(obj, writer, singular) 988 writer.write_end() 989 990 991class BootMenuWriter(Writer): 992 993 def __init__(self): 994 super(BootMenuWriter, self).__init__() 995 996 @staticmethod 997 def write_one(obj, writer, singular=None): 998 if singular is None: 999 singular = 'boot_menu' 1000 writer.write_start(singular) 1001 href = obj.href 1002 if href is not None: 1003 writer.write_attribute('href', href) 1004 if obj.enabled is not None: 1005 Writer.write_boolean(writer, 'enabled', obj.enabled) 1006 writer.write_end() 1007 1008 @staticmethod 1009 def write_many(objs, writer, singular=None, plural=None): 1010 if singular is None: 1011 singular = 'boot_menu' 1012 if plural is None: 1013 plural = 'boot_menus' 1014 writer.write_start(plural) 1015 if isinstance(objs, List): 1016 href = objs.href 1017 if href is not None: 1018 writer.write_attribute('href', href) 1019 for obj in objs: 1020 BootMenuWriter.write_one(obj, writer, singular) 1021 writer.write_end() 1022 1023 1024class BrickProfileDetailWriter(Writer): 1025 1026 def __init__(self): 1027 super(BrickProfileDetailWriter, self).__init__() 1028 1029 @staticmethod 1030 def write_one(obj, writer, singular=None): 1031 if singular is None: 1032 singular = 'brick_profile_detail' 1033 writer.write_start(singular) 1034 href = obj.href 1035 if href is not None: 1036 writer.write_attribute('href', href) 1037 if obj.profile_details is not None: 1038 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 1039 if obj.brick is not None: 1040 GlusterBrickWriter.write_one(obj.brick, writer, 'brick') 1041 writer.write_end() 1042 1043 @staticmethod 1044 def write_many(objs, writer, singular=None, plural=None): 1045 if singular is None: 1046 singular = 'brick_profile_detail' 1047 if plural is None: 1048 plural = 'brick_profile_details' 1049 writer.write_start(plural) 1050 if isinstance(objs, List): 1051 href = objs.href 1052 if href is not None: 1053 writer.write_attribute('href', href) 1054 for obj in objs: 1055 BrickProfileDetailWriter.write_one(obj, writer, singular) 1056 writer.write_end() 1057 1058 1059class CdromWriter(Writer): 1060 1061 def __init__(self): 1062 super(CdromWriter, self).__init__() 1063 1064 @staticmethod 1065 def write_one(obj, writer, singular=None): 1066 if singular is None: 1067 singular = 'cdrom' 1068 writer.write_start(singular) 1069 href = obj.href 1070 if href is not None: 1071 writer.write_attribute('href', href) 1072 if obj.id is not None: 1073 writer.write_attribute('id', obj.id) 1074 if obj.comment is not None: 1075 Writer.write_string(writer, 'comment', obj.comment) 1076 if obj.description is not None: 1077 Writer.write_string(writer, 'description', obj.description) 1078 if obj.file is not None: 1079 FileWriter.write_one(obj.file, writer, 'file') 1080 if obj.name is not None: 1081 Writer.write_string(writer, 'name', obj.name) 1082 if obj.instance_type is not None: 1083 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 1084 if obj.template is not None: 1085 TemplateWriter.write_one(obj.template, writer, 'template') 1086 if obj.vm is not None: 1087 VmWriter.write_one(obj.vm, writer, 'vm') 1088 if obj.vms is not None: 1089 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 1090 writer.write_end() 1091 1092 @staticmethod 1093 def write_many(objs, writer, singular=None, plural=None): 1094 if singular is None: 1095 singular = 'cdrom' 1096 if plural is None: 1097 plural = 'cdroms' 1098 writer.write_start(plural) 1099 if isinstance(objs, List): 1100 href = objs.href 1101 if href is not None: 1102 writer.write_attribute('href', href) 1103 for obj in objs: 1104 CdromWriter.write_one(obj, writer, singular) 1105 writer.write_end() 1106 1107 1108class CertificateWriter(Writer): 1109 1110 def __init__(self): 1111 super(CertificateWriter, self).__init__() 1112 1113 @staticmethod 1114 def write_one(obj, writer, singular=None): 1115 if singular is None: 1116 singular = 'certificate' 1117 writer.write_start(singular) 1118 href = obj.href 1119 if href is not None: 1120 writer.write_attribute('href', href) 1121 if obj.id is not None: 1122 writer.write_attribute('id', obj.id) 1123 if obj.comment is not None: 1124 Writer.write_string(writer, 'comment', obj.comment) 1125 if obj.content is not None: 1126 Writer.write_string(writer, 'content', obj.content) 1127 if obj.description is not None: 1128 Writer.write_string(writer, 'description', obj.description) 1129 if obj.name is not None: 1130 Writer.write_string(writer, 'name', obj.name) 1131 if obj.organization is not None: 1132 Writer.write_string(writer, 'organization', obj.organization) 1133 if obj.subject is not None: 1134 Writer.write_string(writer, 'subject', obj.subject) 1135 writer.write_end() 1136 1137 @staticmethod 1138 def write_many(objs, writer, singular=None, plural=None): 1139 if singular is None: 1140 singular = 'certificate' 1141 if plural is None: 1142 plural = 'certificates' 1143 writer.write_start(plural) 1144 if isinstance(objs, List): 1145 href = objs.href 1146 if href is not None: 1147 writer.write_attribute('href', href) 1148 for obj in objs: 1149 CertificateWriter.write_one(obj, writer, singular) 1150 writer.write_end() 1151 1152 1153class CheckpointWriter(Writer): 1154 1155 def __init__(self): 1156 super(CheckpointWriter, self).__init__() 1157 1158 @staticmethod 1159 def write_one(obj, writer, singular=None): 1160 if singular is None: 1161 singular = 'checkpoint' 1162 writer.write_start(singular) 1163 href = obj.href 1164 if href is not None: 1165 writer.write_attribute('href', href) 1166 if obj.id is not None: 1167 writer.write_attribute('id', obj.id) 1168 if obj.comment is not None: 1169 Writer.write_string(writer, 'comment', obj.comment) 1170 if obj.creation_date is not None: 1171 Writer.write_date(writer, 'creation_date', obj.creation_date) 1172 if obj.description is not None: 1173 Writer.write_string(writer, 'description', obj.description) 1174 if obj.name is not None: 1175 Writer.write_string(writer, 'name', obj.name) 1176 if obj.parent_id is not None: 1177 Writer.write_string(writer, 'parent_id', obj.parent_id) 1178 if obj.state is not None: 1179 Writer.write_string(writer, 'state', obj.state.value) 1180 if obj.disks is not None: 1181 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 1182 if obj.vm is not None: 1183 VmWriter.write_one(obj.vm, writer, 'vm') 1184 writer.write_end() 1185 1186 @staticmethod 1187 def write_many(objs, writer, singular=None, plural=None): 1188 if singular is None: 1189 singular = 'checkpoint' 1190 if plural is None: 1191 plural = 'checkpoints' 1192 writer.write_start(plural) 1193 if isinstance(objs, List): 1194 href = objs.href 1195 if href is not None: 1196 writer.write_attribute('href', href) 1197 for obj in objs: 1198 CheckpointWriter.write_one(obj, writer, singular) 1199 writer.write_end() 1200 1201 1202class CloudInitWriter(Writer): 1203 1204 def __init__(self): 1205 super(CloudInitWriter, self).__init__() 1206 1207 @staticmethod 1208 def write_one(obj, writer, singular=None): 1209 if singular is None: 1210 singular = 'cloud_init' 1211 writer.write_start(singular) 1212 href = obj.href 1213 if href is not None: 1214 writer.write_attribute('href', href) 1215 if obj.authorized_keys is not None: 1216 AuthorizedKeyWriter.write_many(obj.authorized_keys, writer, 'authorized_key', 'authorized_keys') 1217 if obj.files is not None: 1218 FileWriter.write_many(obj.files, writer, 'file', 'files') 1219 if obj.host is not None: 1220 HostWriter.write_one(obj.host, writer, 'host') 1221 if obj.network_configuration is not None: 1222 NetworkConfigurationWriter.write_one(obj.network_configuration, writer, 'network_configuration') 1223 if obj.regenerate_ssh_keys is not None: 1224 Writer.write_boolean(writer, 'regenerate_ssh_keys', obj.regenerate_ssh_keys) 1225 if obj.timezone is not None: 1226 Writer.write_string(writer, 'timezone', obj.timezone) 1227 if obj.users is not None: 1228 UserWriter.write_many(obj.users, writer, 'user', 'users') 1229 writer.write_end() 1230 1231 @staticmethod 1232 def write_many(objs, writer, singular=None, plural=None): 1233 if singular is None: 1234 singular = 'cloud_init' 1235 if plural is None: 1236 plural = 'cloud_inits' 1237 writer.write_start(plural) 1238 if isinstance(objs, List): 1239 href = objs.href 1240 if href is not None: 1241 writer.write_attribute('href', href) 1242 for obj in objs: 1243 CloudInitWriter.write_one(obj, writer, singular) 1244 writer.write_end() 1245 1246 1247class ClusterWriter(Writer): 1248 1249 def __init__(self): 1250 super(ClusterWriter, self).__init__() 1251 1252 @staticmethod 1253 def write_one(obj, writer, singular=None): 1254 if singular is None: 1255 singular = 'cluster' 1256 writer.write_start(singular) 1257 href = obj.href 1258 if href is not None: 1259 writer.write_attribute('href', href) 1260 if obj.id is not None: 1261 writer.write_attribute('id', obj.id) 1262 if obj.ballooning_enabled is not None: 1263 Writer.write_boolean(writer, 'ballooning_enabled', obj.ballooning_enabled) 1264 if obj.bios_type is not None: 1265 Writer.write_string(writer, 'bios_type', obj.bios_type.value) 1266 if obj.comment is not None: 1267 Writer.write_string(writer, 'comment', obj.comment) 1268 if obj.cpu is not None: 1269 CpuWriter.write_one(obj.cpu, writer, 'cpu') 1270 if obj.custom_scheduling_policy_properties is not None: 1271 PropertyWriter.write_many(obj.custom_scheduling_policy_properties, writer, 'property', 'custom_scheduling_policy_properties') 1272 if obj.description is not None: 1273 Writer.write_string(writer, 'description', obj.description) 1274 if obj.display is not None: 1275 DisplayWriter.write_one(obj.display, writer, 'display') 1276 if obj.error_handling is not None: 1277 ErrorHandlingWriter.write_one(obj.error_handling, writer, 'error_handling') 1278 if obj.fencing_policy is not None: 1279 FencingPolicyWriter.write_one(obj.fencing_policy, writer, 'fencing_policy') 1280 if obj.fips_mode is not None: 1281 Writer.write_string(writer, 'fips_mode', obj.fips_mode.value) 1282 if obj.firewall_type is not None: 1283 Writer.write_string(writer, 'firewall_type', obj.firewall_type.value) 1284 if obj.gluster_service is not None: 1285 Writer.write_boolean(writer, 'gluster_service', obj.gluster_service) 1286 if obj.gluster_tuned_profile is not None: 1287 Writer.write_string(writer, 'gluster_tuned_profile', obj.gluster_tuned_profile) 1288 if obj.ha_reservation is not None: 1289 Writer.write_boolean(writer, 'ha_reservation', obj.ha_reservation) 1290 if obj.ksm is not None: 1291 KsmWriter.write_one(obj.ksm, writer, 'ksm') 1292 if obj.log_max_memory_used_threshold is not None: 1293 Writer.write_integer(writer, 'log_max_memory_used_threshold', obj.log_max_memory_used_threshold) 1294 if obj.log_max_memory_used_threshold_type is not None: 1295 Writer.write_string(writer, 'log_max_memory_used_threshold_type', obj.log_max_memory_used_threshold_type.value) 1296 if obj.maintenance_reason_required is not None: 1297 Writer.write_boolean(writer, 'maintenance_reason_required', obj.maintenance_reason_required) 1298 if obj.memory_policy is not None: 1299 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 1300 if obj.migration is not None: 1301 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 1302 if obj.name is not None: 1303 Writer.write_string(writer, 'name', obj.name) 1304 if obj.optional_reason is not None: 1305 Writer.write_boolean(writer, 'optional_reason', obj.optional_reason) 1306 if obj.required_rng_sources is not None: 1307 writer.write_start('required_rng_sources') 1308 for item in obj.required_rng_sources: 1309 if item is not None: 1310 Writer.write_string(writer, 'required_rng_source', item.value) 1311 writer.write_end() 1312 if obj.serial_number is not None: 1313 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 1314 if obj.supported_versions is not None: 1315 VersionWriter.write_many(obj.supported_versions, writer, 'version', 'supported_versions') 1316 if obj.switch_type is not None: 1317 Writer.write_string(writer, 'switch_type', obj.switch_type.value) 1318 if obj.threads_as_cores is not None: 1319 Writer.write_boolean(writer, 'threads_as_cores', obj.threads_as_cores) 1320 if obj.trusted_service is not None: 1321 Writer.write_boolean(writer, 'trusted_service', obj.trusted_service) 1322 if obj.tunnel_migration is not None: 1323 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 1324 if obj.upgrade_correlation_id is not None: 1325 Writer.write_string(writer, 'upgrade_correlation_id', obj.upgrade_correlation_id) 1326 if obj.upgrade_in_progress is not None: 1327 Writer.write_boolean(writer, 'upgrade_in_progress', obj.upgrade_in_progress) 1328 if obj.upgrade_percent_complete is not None: 1329 Writer.write_integer(writer, 'upgrade_percent_complete', obj.upgrade_percent_complete) 1330 if obj.version is not None: 1331 VersionWriter.write_one(obj.version, writer, 'version') 1332 if obj.virt_service is not None: 1333 Writer.write_boolean(writer, 'virt_service', obj.virt_service) 1334 if obj.vnc_encryption is not None: 1335 Writer.write_boolean(writer, 'vnc_encryption', obj.vnc_encryption) 1336 if obj.affinity_groups is not None: 1337 AffinityGroupWriter.write_many(obj.affinity_groups, writer, 'affinity_group', 'affinity_groups') 1338 if obj.cpu_profiles is not None: 1339 CpuProfileWriter.write_many(obj.cpu_profiles, writer, 'cpu_profile', 'cpu_profiles') 1340 if obj.data_center is not None: 1341 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 1342 if obj.enabled_features is not None: 1343 ClusterFeatureWriter.write_many(obj.enabled_features, writer, 'cluster_feature', 'enabled_features') 1344 if obj.external_network_providers is not None: 1345 ExternalProviderWriter.write_many(obj.external_network_providers, writer, 'external_provider', 'external_network_providers') 1346 if obj.gluster_hooks is not None: 1347 GlusterHookWriter.write_many(obj.gluster_hooks, writer, 'gluster_hook', 'gluster_hooks') 1348 if obj.gluster_volumes is not None: 1349 GlusterVolumeWriter.write_many(obj.gluster_volumes, writer, 'gluster_volume', 'gluster_volumes') 1350 if obj.mac_pool is not None: 1351 MacPoolWriter.write_one(obj.mac_pool, writer, 'mac_pool') 1352 if obj.management_network is not None: 1353 NetworkWriter.write_one(obj.management_network, writer, 'management_network') 1354 if obj.network_filters is not None: 1355 NetworkFilterWriter.write_many(obj.network_filters, writer, 'network_filter', 'network_filters') 1356 if obj.networks is not None: 1357 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 1358 if obj.permissions is not None: 1359 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1360 if obj.scheduling_policy is not None: 1361 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 1362 writer.write_end() 1363 1364 @staticmethod 1365 def write_many(objs, writer, singular=None, plural=None): 1366 if singular is None: 1367 singular = 'cluster' 1368 if plural is None: 1369 plural = 'clusters' 1370 writer.write_start(plural) 1371 if isinstance(objs, List): 1372 href = objs.href 1373 if href is not None: 1374 writer.write_attribute('href', href) 1375 for obj in objs: 1376 ClusterWriter.write_one(obj, writer, singular) 1377 writer.write_end() 1378 1379 1380class ClusterFeatureWriter(Writer): 1381 1382 def __init__(self): 1383 super(ClusterFeatureWriter, self).__init__() 1384 1385 @staticmethod 1386 def write_one(obj, writer, singular=None): 1387 if singular is None: 1388 singular = 'cluster_feature' 1389 writer.write_start(singular) 1390 href = obj.href 1391 if href is not None: 1392 writer.write_attribute('href', href) 1393 if obj.id is not None: 1394 writer.write_attribute('id', obj.id) 1395 if obj.comment is not None: 1396 Writer.write_string(writer, 'comment', obj.comment) 1397 if obj.description is not None: 1398 Writer.write_string(writer, 'description', obj.description) 1399 if obj.name is not None: 1400 Writer.write_string(writer, 'name', obj.name) 1401 if obj.cluster_level is not None: 1402 ClusterLevelWriter.write_one(obj.cluster_level, writer, 'cluster_level') 1403 writer.write_end() 1404 1405 @staticmethod 1406 def write_many(objs, writer, singular=None, plural=None): 1407 if singular is None: 1408 singular = 'cluster_feature' 1409 if plural is None: 1410 plural = 'cluster_features' 1411 writer.write_start(plural) 1412 if isinstance(objs, List): 1413 href = objs.href 1414 if href is not None: 1415 writer.write_attribute('href', href) 1416 for obj in objs: 1417 ClusterFeatureWriter.write_one(obj, writer, singular) 1418 writer.write_end() 1419 1420 1421class ClusterLevelWriter(Writer): 1422 1423 def __init__(self): 1424 super(ClusterLevelWriter, self).__init__() 1425 1426 @staticmethod 1427 def write_one(obj, writer, singular=None): 1428 if singular is None: 1429 singular = 'cluster_level' 1430 writer.write_start(singular) 1431 href = obj.href 1432 if href is not None: 1433 writer.write_attribute('href', href) 1434 if obj.id is not None: 1435 writer.write_attribute('id', obj.id) 1436 if obj.comment is not None: 1437 Writer.write_string(writer, 'comment', obj.comment) 1438 if obj.cpu_types is not None: 1439 CpuTypeWriter.write_many(obj.cpu_types, writer, 'cpu_type', 'cpu_types') 1440 if obj.description is not None: 1441 Writer.write_string(writer, 'description', obj.description) 1442 if obj.name is not None: 1443 Writer.write_string(writer, 'name', obj.name) 1444 if obj.permits is not None: 1445 PermitWriter.write_many(obj.permits, writer, 'permit', 'permits') 1446 if obj.cluster_features is not None: 1447 ClusterFeatureWriter.write_many(obj.cluster_features, writer, 'cluster_feature', 'cluster_features') 1448 writer.write_end() 1449 1450 @staticmethod 1451 def write_many(objs, writer, singular=None, plural=None): 1452 if singular is None: 1453 singular = 'cluster_level' 1454 if plural is None: 1455 plural = 'cluster_levels' 1456 writer.write_start(plural) 1457 if isinstance(objs, List): 1458 href = objs.href 1459 if href is not None: 1460 writer.write_attribute('href', href) 1461 for obj in objs: 1462 ClusterLevelWriter.write_one(obj, writer, singular) 1463 writer.write_end() 1464 1465 1466class ConfigurationWriter(Writer): 1467 1468 def __init__(self): 1469 super(ConfigurationWriter, self).__init__() 1470 1471 @staticmethod 1472 def write_one(obj, writer, singular=None): 1473 if singular is None: 1474 singular = 'configuration' 1475 writer.write_start(singular) 1476 href = obj.href 1477 if href is not None: 1478 writer.write_attribute('href', href) 1479 if obj.data is not None: 1480 Writer.write_string(writer, 'data', obj.data) 1481 if obj.type is not None: 1482 Writer.write_string(writer, 'type', obj.type.value) 1483 writer.write_end() 1484 1485 @staticmethod 1486 def write_many(objs, writer, singular=None, plural=None): 1487 if singular is None: 1488 singular = 'configuration' 1489 if plural is None: 1490 plural = 'configurations' 1491 writer.write_start(plural) 1492 if isinstance(objs, List): 1493 href = objs.href 1494 if href is not None: 1495 writer.write_attribute('href', href) 1496 for obj in objs: 1497 ConfigurationWriter.write_one(obj, writer, singular) 1498 writer.write_end() 1499 1500 1501class ConsoleWriter(Writer): 1502 1503 def __init__(self): 1504 super(ConsoleWriter, self).__init__() 1505 1506 @staticmethod 1507 def write_one(obj, writer, singular=None): 1508 if singular is None: 1509 singular = 'console' 1510 writer.write_start(singular) 1511 href = obj.href 1512 if href is not None: 1513 writer.write_attribute('href', href) 1514 if obj.enabled is not None: 1515 Writer.write_boolean(writer, 'enabled', obj.enabled) 1516 writer.write_end() 1517 1518 @staticmethod 1519 def write_many(objs, writer, singular=None, plural=None): 1520 if singular is None: 1521 singular = 'console' 1522 if plural is None: 1523 plural = 'consoles' 1524 writer.write_start(plural) 1525 if isinstance(objs, List): 1526 href = objs.href 1527 if href is not None: 1528 writer.write_attribute('href', href) 1529 for obj in objs: 1530 ConsoleWriter.write_one(obj, writer, singular) 1531 writer.write_end() 1532 1533 1534class CoreWriter(Writer): 1535 1536 def __init__(self): 1537 super(CoreWriter, self).__init__() 1538 1539 @staticmethod 1540 def write_one(obj, writer, singular=None): 1541 if singular is None: 1542 singular = 'core' 1543 writer.write_start(singular) 1544 href = obj.href 1545 if href is not None: 1546 writer.write_attribute('href', href) 1547 if obj.index is not None: 1548 Writer.write_integer(writer, 'index', obj.index) 1549 if obj.socket is not None: 1550 Writer.write_integer(writer, 'socket', obj.socket) 1551 writer.write_end() 1552 1553 @staticmethod 1554 def write_many(objs, writer, singular=None, plural=None): 1555 if singular is None: 1556 singular = 'core' 1557 if plural is None: 1558 plural = 'cores' 1559 writer.write_start(plural) 1560 if isinstance(objs, List): 1561 href = objs.href 1562 if href is not None: 1563 writer.write_attribute('href', href) 1564 for obj in objs: 1565 CoreWriter.write_one(obj, writer, singular) 1566 writer.write_end() 1567 1568 1569class CpuWriter(Writer): 1570 1571 def __init__(self): 1572 super(CpuWriter, self).__init__() 1573 1574 @staticmethod 1575 def write_one(obj, writer, singular=None): 1576 if singular is None: 1577 singular = 'cpu' 1578 writer.write_start(singular) 1579 href = obj.href 1580 if href is not None: 1581 writer.write_attribute('href', href) 1582 if obj.architecture is not None: 1583 Writer.write_string(writer, 'architecture', obj.architecture.value) 1584 if obj.cores is not None: 1585 CoreWriter.write_many(obj.cores, writer, 'core', 'cores') 1586 if obj.cpu_tune is not None: 1587 CpuTuneWriter.write_one(obj.cpu_tune, writer, 'cpu_tune') 1588 if obj.level is not None: 1589 Writer.write_integer(writer, 'level', obj.level) 1590 if obj.mode is not None: 1591 Writer.write_string(writer, 'mode', obj.mode.value) 1592 if obj.name is not None: 1593 Writer.write_string(writer, 'name', obj.name) 1594 if obj.speed is not None: 1595 Writer.write_decimal(writer, 'speed', obj.speed) 1596 if obj.topology is not None: 1597 CpuTopologyWriter.write_one(obj.topology, writer, 'topology') 1598 if obj.type is not None: 1599 Writer.write_string(writer, 'type', obj.type) 1600 writer.write_end() 1601 1602 @staticmethod 1603 def write_many(objs, writer, singular=None, plural=None): 1604 if singular is None: 1605 singular = 'cpu' 1606 if plural is None: 1607 plural = 'cpus' 1608 writer.write_start(plural) 1609 if isinstance(objs, List): 1610 href = objs.href 1611 if href is not None: 1612 writer.write_attribute('href', href) 1613 for obj in objs: 1614 CpuWriter.write_one(obj, writer, singular) 1615 writer.write_end() 1616 1617 1618class CpuProfileWriter(Writer): 1619 1620 def __init__(self): 1621 super(CpuProfileWriter, self).__init__() 1622 1623 @staticmethod 1624 def write_one(obj, writer, singular=None): 1625 if singular is None: 1626 singular = 'cpu_profile' 1627 writer.write_start(singular) 1628 href = obj.href 1629 if href is not None: 1630 writer.write_attribute('href', href) 1631 if obj.id is not None: 1632 writer.write_attribute('id', obj.id) 1633 if obj.comment is not None: 1634 Writer.write_string(writer, 'comment', obj.comment) 1635 if obj.description is not None: 1636 Writer.write_string(writer, 'description', obj.description) 1637 if obj.name is not None: 1638 Writer.write_string(writer, 'name', obj.name) 1639 if obj.cluster is not None: 1640 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 1641 if obj.permissions is not None: 1642 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1643 if obj.qos is not None: 1644 QosWriter.write_one(obj.qos, writer, 'qos') 1645 writer.write_end() 1646 1647 @staticmethod 1648 def write_many(objs, writer, singular=None, plural=None): 1649 if singular is None: 1650 singular = 'cpu_profile' 1651 if plural is None: 1652 plural = 'cpu_profiles' 1653 writer.write_start(plural) 1654 if isinstance(objs, List): 1655 href = objs.href 1656 if href is not None: 1657 writer.write_attribute('href', href) 1658 for obj in objs: 1659 CpuProfileWriter.write_one(obj, writer, singular) 1660 writer.write_end() 1661 1662 1663class CpuTopologyWriter(Writer): 1664 1665 def __init__(self): 1666 super(CpuTopologyWriter, self).__init__() 1667 1668 @staticmethod 1669 def write_one(obj, writer, singular=None): 1670 if singular is None: 1671 singular = 'cpu_topology' 1672 writer.write_start(singular) 1673 href = obj.href 1674 if href is not None: 1675 writer.write_attribute('href', href) 1676 if obj.cores is not None: 1677 Writer.write_integer(writer, 'cores', obj.cores) 1678 if obj.sockets is not None: 1679 Writer.write_integer(writer, 'sockets', obj.sockets) 1680 if obj.threads is not None: 1681 Writer.write_integer(writer, 'threads', obj.threads) 1682 writer.write_end() 1683 1684 @staticmethod 1685 def write_many(objs, writer, singular=None, plural=None): 1686 if singular is None: 1687 singular = 'cpu_topology' 1688 if plural is None: 1689 plural = 'cpu_topologies' 1690 writer.write_start(plural) 1691 if isinstance(objs, List): 1692 href = objs.href 1693 if href is not None: 1694 writer.write_attribute('href', href) 1695 for obj in objs: 1696 CpuTopologyWriter.write_one(obj, writer, singular) 1697 writer.write_end() 1698 1699 1700class CpuTuneWriter(Writer): 1701 1702 def __init__(self): 1703 super(CpuTuneWriter, self).__init__() 1704 1705 @staticmethod 1706 def write_one(obj, writer, singular=None): 1707 if singular is None: 1708 singular = 'cpu_tune' 1709 writer.write_start(singular) 1710 href = obj.href 1711 if href is not None: 1712 writer.write_attribute('href', href) 1713 if obj.vcpu_pins is not None: 1714 VcpuPinWriter.write_many(obj.vcpu_pins, writer, 'vcpu_pin', 'vcpu_pins') 1715 writer.write_end() 1716 1717 @staticmethod 1718 def write_many(objs, writer, singular=None, plural=None): 1719 if singular is None: 1720 singular = 'cpu_tune' 1721 if plural is None: 1722 plural = 'cpu_tunes' 1723 writer.write_start(plural) 1724 if isinstance(objs, List): 1725 href = objs.href 1726 if href is not None: 1727 writer.write_attribute('href', href) 1728 for obj in objs: 1729 CpuTuneWriter.write_one(obj, writer, singular) 1730 writer.write_end() 1731 1732 1733class CpuTypeWriter(Writer): 1734 1735 def __init__(self): 1736 super(CpuTypeWriter, self).__init__() 1737 1738 @staticmethod 1739 def write_one(obj, writer, singular=None): 1740 if singular is None: 1741 singular = 'cpu_type' 1742 writer.write_start(singular) 1743 href = obj.href 1744 if href is not None: 1745 writer.write_attribute('href', href) 1746 if obj.architecture is not None: 1747 Writer.write_string(writer, 'architecture', obj.architecture.value) 1748 if obj.level is not None: 1749 Writer.write_integer(writer, 'level', obj.level) 1750 if obj.name is not None: 1751 Writer.write_string(writer, 'name', obj.name) 1752 writer.write_end() 1753 1754 @staticmethod 1755 def write_many(objs, writer, singular=None, plural=None): 1756 if singular is None: 1757 singular = 'cpu_type' 1758 if plural is None: 1759 plural = 'cpu_types' 1760 writer.write_start(plural) 1761 if isinstance(objs, List): 1762 href = objs.href 1763 if href is not None: 1764 writer.write_attribute('href', href) 1765 for obj in objs: 1766 CpuTypeWriter.write_one(obj, writer, singular) 1767 writer.write_end() 1768 1769 1770class CustomPropertyWriter(Writer): 1771 1772 def __init__(self): 1773 super(CustomPropertyWriter, self).__init__() 1774 1775 @staticmethod 1776 def write_one(obj, writer, singular=None): 1777 if singular is None: 1778 singular = 'custom_property' 1779 writer.write_start(singular) 1780 href = obj.href 1781 if href is not None: 1782 writer.write_attribute('href', href) 1783 if obj.name is not None: 1784 Writer.write_string(writer, 'name', obj.name) 1785 if obj.regexp is not None: 1786 Writer.write_string(writer, 'regexp', obj.regexp) 1787 if obj.value is not None: 1788 Writer.write_string(writer, 'value', obj.value) 1789 writer.write_end() 1790 1791 @staticmethod 1792 def write_many(objs, writer, singular=None, plural=None): 1793 if singular is None: 1794 singular = 'custom_property' 1795 if plural is None: 1796 plural = 'custom_properties' 1797 writer.write_start(plural) 1798 if isinstance(objs, List): 1799 href = objs.href 1800 if href is not None: 1801 writer.write_attribute('href', href) 1802 for obj in objs: 1803 CustomPropertyWriter.write_one(obj, writer, singular) 1804 writer.write_end() 1805 1806 1807class DataCenterWriter(Writer): 1808 1809 def __init__(self): 1810 super(DataCenterWriter, self).__init__() 1811 1812 @staticmethod 1813 def write_one(obj, writer, singular=None): 1814 if singular is None: 1815 singular = 'data_center' 1816 writer.write_start(singular) 1817 href = obj.href 1818 if href is not None: 1819 writer.write_attribute('href', href) 1820 if obj.id is not None: 1821 writer.write_attribute('id', obj.id) 1822 if obj.comment is not None: 1823 Writer.write_string(writer, 'comment', obj.comment) 1824 if obj.description is not None: 1825 Writer.write_string(writer, 'description', obj.description) 1826 if obj.local is not None: 1827 Writer.write_boolean(writer, 'local', obj.local) 1828 if obj.name is not None: 1829 Writer.write_string(writer, 'name', obj.name) 1830 if obj.quota_mode is not None: 1831 Writer.write_string(writer, 'quota_mode', obj.quota_mode.value) 1832 if obj.status is not None: 1833 Writer.write_string(writer, 'status', obj.status.value) 1834 if obj.storage_format is not None: 1835 Writer.write_string(writer, 'storage_format', obj.storage_format.value) 1836 if obj.supported_versions is not None: 1837 VersionWriter.write_many(obj.supported_versions, writer, 'version', 'supported_versions') 1838 if obj.version is not None: 1839 VersionWriter.write_one(obj.version, writer, 'version') 1840 if obj.clusters is not None: 1841 ClusterWriter.write_many(obj.clusters, writer, 'cluster', 'clusters') 1842 if obj.iscsi_bonds is not None: 1843 IscsiBondWriter.write_many(obj.iscsi_bonds, writer, 'iscsi_bond', 'iscsi_bonds') 1844 if obj.mac_pool is not None: 1845 MacPoolWriter.write_one(obj.mac_pool, writer, 'mac_pool') 1846 if obj.networks is not None: 1847 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 1848 if obj.permissions is not None: 1849 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1850 if obj.qoss is not None: 1851 QosWriter.write_many(obj.qoss, writer, 'qos', 'qoss') 1852 if obj.quotas is not None: 1853 QuotaWriter.write_many(obj.quotas, writer, 'quota', 'quotas') 1854 if obj.storage_domains is not None: 1855 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 1856 writer.write_end() 1857 1858 @staticmethod 1859 def write_many(objs, writer, singular=None, plural=None): 1860 if singular is None: 1861 singular = 'data_center' 1862 if plural is None: 1863 plural = 'data_centers' 1864 writer.write_start(plural) 1865 if isinstance(objs, List): 1866 href = objs.href 1867 if href is not None: 1868 writer.write_attribute('href', href) 1869 for obj in objs: 1870 DataCenterWriter.write_one(obj, writer, singular) 1871 writer.write_end() 1872 1873 1874class DeviceWriter(Writer): 1875 1876 def __init__(self): 1877 super(DeviceWriter, self).__init__() 1878 1879 @staticmethod 1880 def write_one(obj, writer, singular=None): 1881 if singular is None: 1882 singular = 'device' 1883 writer.write_start(singular) 1884 href = obj.href 1885 if href is not None: 1886 writer.write_attribute('href', href) 1887 if obj.id is not None: 1888 writer.write_attribute('id', obj.id) 1889 if obj.comment is not None: 1890 Writer.write_string(writer, 'comment', obj.comment) 1891 if obj.description is not None: 1892 Writer.write_string(writer, 'description', obj.description) 1893 if obj.name is not None: 1894 Writer.write_string(writer, 'name', obj.name) 1895 if obj.instance_type is not None: 1896 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 1897 if obj.template is not None: 1898 TemplateWriter.write_one(obj.template, writer, 'template') 1899 if obj.vm is not None: 1900 VmWriter.write_one(obj.vm, writer, 'vm') 1901 if obj.vms is not None: 1902 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 1903 writer.write_end() 1904 1905 @staticmethod 1906 def write_many(objs, writer, singular=None, plural=None): 1907 if singular is None: 1908 singular = 'device' 1909 if plural is None: 1910 plural = 'devices' 1911 writer.write_start(plural) 1912 if isinstance(objs, List): 1913 href = objs.href 1914 if href is not None: 1915 writer.write_attribute('href', href) 1916 for obj in objs: 1917 DeviceWriter.write_one(obj, writer, singular) 1918 writer.write_end() 1919 1920 1921class DiskWriter(Writer): 1922 1923 def __init__(self): 1924 super(DiskWriter, self).__init__() 1925 1926 @staticmethod 1927 def write_one(obj, writer, singular=None): 1928 if singular is None: 1929 singular = 'disk' 1930 writer.write_start(singular) 1931 href = obj.href 1932 if href is not None: 1933 writer.write_attribute('href', href) 1934 if obj.id is not None: 1935 writer.write_attribute('id', obj.id) 1936 if obj.active is not None: 1937 Writer.write_boolean(writer, 'active', obj.active) 1938 if obj.actual_size is not None: 1939 Writer.write_integer(writer, 'actual_size', obj.actual_size) 1940 if obj.alias is not None: 1941 Writer.write_string(writer, 'alias', obj.alias) 1942 if obj.backup is not None: 1943 Writer.write_string(writer, 'backup', obj.backup.value) 1944 if obj.backup_mode is not None: 1945 Writer.write_string(writer, 'backup_mode', obj.backup_mode.value) 1946 if obj.bootable is not None: 1947 Writer.write_boolean(writer, 'bootable', obj.bootable) 1948 if obj.comment is not None: 1949 Writer.write_string(writer, 'comment', obj.comment) 1950 if obj.content_type is not None: 1951 Writer.write_string(writer, 'content_type', obj.content_type.value) 1952 if obj.description is not None: 1953 Writer.write_string(writer, 'description', obj.description) 1954 if obj.external_disk is not None: 1955 Writer.write_string(writer, 'external_disk', obj.external_disk) 1956 if obj.format is not None: 1957 Writer.write_string(writer, 'format', obj.format.value) 1958 if obj.image_id is not None: 1959 Writer.write_string(writer, 'image_id', obj.image_id) 1960 if obj.initial_size is not None: 1961 Writer.write_integer(writer, 'initial_size', obj.initial_size) 1962 if obj.interface is not None: 1963 Writer.write_string(writer, 'interface', obj.interface.value) 1964 if obj.logical_name is not None: 1965 Writer.write_string(writer, 'logical_name', obj.logical_name) 1966 if obj.lun_storage is not None: 1967 HostStorageWriter.write_one(obj.lun_storage, writer, 'lun_storage') 1968 if obj.name is not None: 1969 Writer.write_string(writer, 'name', obj.name) 1970 if obj.propagate_errors is not None: 1971 Writer.write_boolean(writer, 'propagate_errors', obj.propagate_errors) 1972 if obj.provisioned_size is not None: 1973 Writer.write_integer(writer, 'provisioned_size', obj.provisioned_size) 1974 if obj.qcow_version is not None: 1975 Writer.write_string(writer, 'qcow_version', obj.qcow_version.value) 1976 if obj.read_only is not None: 1977 Writer.write_boolean(writer, 'read_only', obj.read_only) 1978 if obj.sgio is not None: 1979 Writer.write_string(writer, 'sgio', obj.sgio.value) 1980 if obj.shareable is not None: 1981 Writer.write_boolean(writer, 'shareable', obj.shareable) 1982 if obj.sparse is not None: 1983 Writer.write_boolean(writer, 'sparse', obj.sparse) 1984 if obj.status is not None: 1985 Writer.write_string(writer, 'status', obj.status.value) 1986 if obj.storage_type is not None: 1987 Writer.write_string(writer, 'storage_type', obj.storage_type.value) 1988 if obj.total_size is not None: 1989 Writer.write_integer(writer, 'total_size', obj.total_size) 1990 if obj.uses_scsi_reservation is not None: 1991 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 1992 if obj.wipe_after_delete is not None: 1993 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 1994 if obj.disk_profile is not None: 1995 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 1996 if obj.disk_snapshots is not None: 1997 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 1998 if obj.instance_type is not None: 1999 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 2000 if obj.openstack_volume_type is not None: 2001 OpenStackVolumeTypeWriter.write_one(obj.openstack_volume_type, writer, 'openstack_volume_type') 2002 if obj.permissions is not None: 2003 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2004 if obj.quota is not None: 2005 QuotaWriter.write_one(obj.quota, writer, 'quota') 2006 if obj.snapshot is not None: 2007 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 2008 if obj.statistics is not None: 2009 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 2010 if obj.storage_domain is not None: 2011 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2012 if obj.storage_domains is not None: 2013 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 2014 if obj.template is not None: 2015 TemplateWriter.write_one(obj.template, writer, 'template') 2016 if obj.vm is not None: 2017 VmWriter.write_one(obj.vm, writer, 'vm') 2018 if obj.vms is not None: 2019 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 2020 writer.write_end() 2021 2022 @staticmethod 2023 def write_many(objs, writer, singular=None, plural=None): 2024 if singular is None: 2025 singular = 'disk' 2026 if plural is None: 2027 plural = 'disks' 2028 writer.write_start(plural) 2029 if isinstance(objs, List): 2030 href = objs.href 2031 if href is not None: 2032 writer.write_attribute('href', href) 2033 for obj in objs: 2034 DiskWriter.write_one(obj, writer, singular) 2035 writer.write_end() 2036 2037 2038class DiskAttachmentWriter(Writer): 2039 2040 def __init__(self): 2041 super(DiskAttachmentWriter, self).__init__() 2042 2043 @staticmethod 2044 def write_one(obj, writer, singular=None): 2045 if singular is None: 2046 singular = 'disk_attachment' 2047 writer.write_start(singular) 2048 href = obj.href 2049 if href is not None: 2050 writer.write_attribute('href', href) 2051 if obj.id is not None: 2052 writer.write_attribute('id', obj.id) 2053 if obj.active is not None: 2054 Writer.write_boolean(writer, 'active', obj.active) 2055 if obj.bootable is not None: 2056 Writer.write_boolean(writer, 'bootable', obj.bootable) 2057 if obj.comment is not None: 2058 Writer.write_string(writer, 'comment', obj.comment) 2059 if obj.description is not None: 2060 Writer.write_string(writer, 'description', obj.description) 2061 if obj.interface is not None: 2062 Writer.write_string(writer, 'interface', obj.interface.value) 2063 if obj.logical_name is not None: 2064 Writer.write_string(writer, 'logical_name', obj.logical_name) 2065 if obj.name is not None: 2066 Writer.write_string(writer, 'name', obj.name) 2067 if obj.pass_discard is not None: 2068 Writer.write_boolean(writer, 'pass_discard', obj.pass_discard) 2069 if obj.read_only is not None: 2070 Writer.write_boolean(writer, 'read_only', obj.read_only) 2071 if obj.uses_scsi_reservation is not None: 2072 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 2073 if obj.disk is not None: 2074 DiskWriter.write_one(obj.disk, writer, 'disk') 2075 if obj.template is not None: 2076 TemplateWriter.write_one(obj.template, writer, 'template') 2077 if obj.vm is not None: 2078 VmWriter.write_one(obj.vm, writer, 'vm') 2079 writer.write_end() 2080 2081 @staticmethod 2082 def write_many(objs, writer, singular=None, plural=None): 2083 if singular is None: 2084 singular = 'disk_attachment' 2085 if plural is None: 2086 plural = 'disk_attachments' 2087 writer.write_start(plural) 2088 if isinstance(objs, List): 2089 href = objs.href 2090 if href is not None: 2091 writer.write_attribute('href', href) 2092 for obj in objs: 2093 DiskAttachmentWriter.write_one(obj, writer, singular) 2094 writer.write_end() 2095 2096 2097class DiskProfileWriter(Writer): 2098 2099 def __init__(self): 2100 super(DiskProfileWriter, self).__init__() 2101 2102 @staticmethod 2103 def write_one(obj, writer, singular=None): 2104 if singular is None: 2105 singular = 'disk_profile' 2106 writer.write_start(singular) 2107 href = obj.href 2108 if href is not None: 2109 writer.write_attribute('href', href) 2110 if obj.id is not None: 2111 writer.write_attribute('id', obj.id) 2112 if obj.comment is not None: 2113 Writer.write_string(writer, 'comment', obj.comment) 2114 if obj.description is not None: 2115 Writer.write_string(writer, 'description', obj.description) 2116 if obj.name is not None: 2117 Writer.write_string(writer, 'name', obj.name) 2118 if obj.permissions is not None: 2119 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2120 if obj.qos is not None: 2121 QosWriter.write_one(obj.qos, writer, 'qos') 2122 if obj.storage_domain is not None: 2123 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2124 writer.write_end() 2125 2126 @staticmethod 2127 def write_many(objs, writer, singular=None, plural=None): 2128 if singular is None: 2129 singular = 'disk_profile' 2130 if plural is None: 2131 plural = 'disk_profiles' 2132 writer.write_start(plural) 2133 if isinstance(objs, List): 2134 href = objs.href 2135 if href is not None: 2136 writer.write_attribute('href', href) 2137 for obj in objs: 2138 DiskProfileWriter.write_one(obj, writer, singular) 2139 writer.write_end() 2140 2141 2142class DiskSnapshotWriter(Writer): 2143 2144 def __init__(self): 2145 super(DiskSnapshotWriter, self).__init__() 2146 2147 @staticmethod 2148 def write_one(obj, writer, singular=None): 2149 if singular is None: 2150 singular = 'disk_snapshot' 2151 writer.write_start(singular) 2152 href = obj.href 2153 if href is not None: 2154 writer.write_attribute('href', href) 2155 if obj.id is not None: 2156 writer.write_attribute('id', obj.id) 2157 if obj.active is not None: 2158 Writer.write_boolean(writer, 'active', obj.active) 2159 if obj.actual_size is not None: 2160 Writer.write_integer(writer, 'actual_size', obj.actual_size) 2161 if obj.alias is not None: 2162 Writer.write_string(writer, 'alias', obj.alias) 2163 if obj.backup is not None: 2164 Writer.write_string(writer, 'backup', obj.backup.value) 2165 if obj.backup_mode is not None: 2166 Writer.write_string(writer, 'backup_mode', obj.backup_mode.value) 2167 if obj.bootable is not None: 2168 Writer.write_boolean(writer, 'bootable', obj.bootable) 2169 if obj.comment is not None: 2170 Writer.write_string(writer, 'comment', obj.comment) 2171 if obj.content_type is not None: 2172 Writer.write_string(writer, 'content_type', obj.content_type.value) 2173 if obj.description is not None: 2174 Writer.write_string(writer, 'description', obj.description) 2175 if obj.external_disk is not None: 2176 Writer.write_string(writer, 'external_disk', obj.external_disk) 2177 if obj.format is not None: 2178 Writer.write_string(writer, 'format', obj.format.value) 2179 if obj.image_id is not None: 2180 Writer.write_string(writer, 'image_id', obj.image_id) 2181 if obj.initial_size is not None: 2182 Writer.write_integer(writer, 'initial_size', obj.initial_size) 2183 if obj.interface is not None: 2184 Writer.write_string(writer, 'interface', obj.interface.value) 2185 if obj.logical_name is not None: 2186 Writer.write_string(writer, 'logical_name', obj.logical_name) 2187 if obj.lun_storage is not None: 2188 HostStorageWriter.write_one(obj.lun_storage, writer, 'lun_storage') 2189 if obj.name is not None: 2190 Writer.write_string(writer, 'name', obj.name) 2191 if obj.propagate_errors is not None: 2192 Writer.write_boolean(writer, 'propagate_errors', obj.propagate_errors) 2193 if obj.provisioned_size is not None: 2194 Writer.write_integer(writer, 'provisioned_size', obj.provisioned_size) 2195 if obj.qcow_version is not None: 2196 Writer.write_string(writer, 'qcow_version', obj.qcow_version.value) 2197 if obj.read_only is not None: 2198 Writer.write_boolean(writer, 'read_only', obj.read_only) 2199 if obj.sgio is not None: 2200 Writer.write_string(writer, 'sgio', obj.sgio.value) 2201 if obj.shareable is not None: 2202 Writer.write_boolean(writer, 'shareable', obj.shareable) 2203 if obj.sparse is not None: 2204 Writer.write_boolean(writer, 'sparse', obj.sparse) 2205 if obj.status is not None: 2206 Writer.write_string(writer, 'status', obj.status.value) 2207 if obj.storage_type is not None: 2208 Writer.write_string(writer, 'storage_type', obj.storage_type.value) 2209 if obj.total_size is not None: 2210 Writer.write_integer(writer, 'total_size', obj.total_size) 2211 if obj.uses_scsi_reservation is not None: 2212 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 2213 if obj.wipe_after_delete is not None: 2214 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 2215 if obj.disk is not None: 2216 DiskWriter.write_one(obj.disk, writer, 'disk') 2217 if obj.disk_profile is not None: 2218 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 2219 if obj.disk_snapshots is not None: 2220 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 2221 if obj.instance_type is not None: 2222 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 2223 if obj.openstack_volume_type is not None: 2224 OpenStackVolumeTypeWriter.write_one(obj.openstack_volume_type, writer, 'openstack_volume_type') 2225 if obj.parent is not None: 2226 DiskSnapshotWriter.write_one(obj.parent, writer, 'parent') 2227 if obj.permissions is not None: 2228 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2229 if obj.quota is not None: 2230 QuotaWriter.write_one(obj.quota, writer, 'quota') 2231 if obj.snapshot is not None: 2232 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 2233 if obj.statistics is not None: 2234 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 2235 if obj.storage_domain is not None: 2236 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2237 if obj.storage_domains is not None: 2238 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 2239 if obj.template is not None: 2240 TemplateWriter.write_one(obj.template, writer, 'template') 2241 if obj.vm is not None: 2242 VmWriter.write_one(obj.vm, writer, 'vm') 2243 if obj.vms is not None: 2244 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 2245 writer.write_end() 2246 2247 @staticmethod 2248 def write_many(objs, writer, singular=None, plural=None): 2249 if singular is None: 2250 singular = 'disk_snapshot' 2251 if plural is None: 2252 plural = 'disk_snapshots' 2253 writer.write_start(plural) 2254 if isinstance(objs, List): 2255 href = objs.href 2256 if href is not None: 2257 writer.write_attribute('href', href) 2258 for obj in objs: 2259 DiskSnapshotWriter.write_one(obj, writer, singular) 2260 writer.write_end() 2261 2262 2263class DisplayWriter(Writer): 2264 2265 def __init__(self): 2266 super(DisplayWriter, self).__init__() 2267 2268 @staticmethod 2269 def write_one(obj, writer, singular=None): 2270 if singular is None: 2271 singular = 'display' 2272 writer.write_start(singular) 2273 href = obj.href 2274 if href is not None: 2275 writer.write_attribute('href', href) 2276 if obj.address is not None: 2277 Writer.write_string(writer, 'address', obj.address) 2278 if obj.allow_override is not None: 2279 Writer.write_boolean(writer, 'allow_override', obj.allow_override) 2280 if obj.certificate is not None: 2281 CertificateWriter.write_one(obj.certificate, writer, 'certificate') 2282 if obj.copy_paste_enabled is not None: 2283 Writer.write_boolean(writer, 'copy_paste_enabled', obj.copy_paste_enabled) 2284 if obj.disconnect_action is not None: 2285 Writer.write_string(writer, 'disconnect_action', obj.disconnect_action) 2286 if obj.disconnect_action_delay is not None: 2287 Writer.write_integer(writer, 'disconnect_action_delay', obj.disconnect_action_delay) 2288 if obj.file_transfer_enabled is not None: 2289 Writer.write_boolean(writer, 'file_transfer_enabled', obj.file_transfer_enabled) 2290 if obj.keyboard_layout is not None: 2291 Writer.write_string(writer, 'keyboard_layout', obj.keyboard_layout) 2292 if obj.monitors is not None: 2293 Writer.write_integer(writer, 'monitors', obj.monitors) 2294 if obj.port is not None: 2295 Writer.write_integer(writer, 'port', obj.port) 2296 if obj.proxy is not None: 2297 Writer.write_string(writer, 'proxy', obj.proxy) 2298 if obj.secure_port is not None: 2299 Writer.write_integer(writer, 'secure_port', obj.secure_port) 2300 if obj.single_qxl_pci is not None: 2301 Writer.write_boolean(writer, 'single_qxl_pci', obj.single_qxl_pci) 2302 if obj.smartcard_enabled is not None: 2303 Writer.write_boolean(writer, 'smartcard_enabled', obj.smartcard_enabled) 2304 if obj.type is not None: 2305 Writer.write_string(writer, 'type', obj.type.value) 2306 if obj.video_type is not None: 2307 Writer.write_string(writer, 'video_type', obj.video_type.value) 2308 writer.write_end() 2309 2310 @staticmethod 2311 def write_many(objs, writer, singular=None, plural=None): 2312 if singular is None: 2313 singular = 'display' 2314 if plural is None: 2315 plural = 'displays' 2316 writer.write_start(plural) 2317 if isinstance(objs, List): 2318 href = objs.href 2319 if href is not None: 2320 writer.write_attribute('href', href) 2321 for obj in objs: 2322 DisplayWriter.write_one(obj, writer, singular) 2323 writer.write_end() 2324 2325 2326class DnsWriter(Writer): 2327 2328 def __init__(self): 2329 super(DnsWriter, self).__init__() 2330 2331 @staticmethod 2332 def write_one(obj, writer, singular=None): 2333 if singular is None: 2334 singular = 'dns' 2335 writer.write_start(singular) 2336 href = obj.href 2337 if href is not None: 2338 writer.write_attribute('href', href) 2339 if obj.search_domains is not None: 2340 HostWriter.write_many(obj.search_domains, writer, 'host', 'search_domains') 2341 if obj.servers is not None: 2342 HostWriter.write_many(obj.servers, writer, 'host', 'servers') 2343 writer.write_end() 2344 2345 @staticmethod 2346 def write_many(objs, writer, singular=None, plural=None): 2347 if singular is None: 2348 singular = 'dns' 2349 if plural is None: 2350 plural = 'dnss' 2351 writer.write_start(plural) 2352 if isinstance(objs, List): 2353 href = objs.href 2354 if href is not None: 2355 writer.write_attribute('href', href) 2356 for obj in objs: 2357 DnsWriter.write_one(obj, writer, singular) 2358 writer.write_end() 2359 2360 2361class DnsResolverConfigurationWriter(Writer): 2362 2363 def __init__(self): 2364 super(DnsResolverConfigurationWriter, self).__init__() 2365 2366 @staticmethod 2367 def write_one(obj, writer, singular=None): 2368 if singular is None: 2369 singular = 'dns_resolver_configuration' 2370 writer.write_start(singular) 2371 href = obj.href 2372 if href is not None: 2373 writer.write_attribute('href', href) 2374 if obj.name_servers is not None: 2375 writer.write_start('name_servers') 2376 for item in obj.name_servers: 2377 if item is not None: 2378 Writer.write_string(writer, 'name_server', item) 2379 writer.write_end() 2380 writer.write_end() 2381 2382 @staticmethod 2383 def write_many(objs, writer, singular=None, plural=None): 2384 if singular is None: 2385 singular = 'dns_resolver_configuration' 2386 if plural is None: 2387 plural = 'dns_resolver_configurations' 2388 writer.write_start(plural) 2389 if isinstance(objs, List): 2390 href = objs.href 2391 if href is not None: 2392 writer.write_attribute('href', href) 2393 for obj in objs: 2394 DnsResolverConfigurationWriter.write_one(obj, writer, singular) 2395 writer.write_end() 2396 2397 2398class DomainWriter(Writer): 2399 2400 def __init__(self): 2401 super(DomainWriter, self).__init__() 2402 2403 @staticmethod 2404 def write_one(obj, writer, singular=None): 2405 if singular is None: 2406 singular = 'domain' 2407 writer.write_start(singular) 2408 href = obj.href 2409 if href is not None: 2410 writer.write_attribute('href', href) 2411 if obj.id is not None: 2412 writer.write_attribute('id', obj.id) 2413 if obj.comment is not None: 2414 Writer.write_string(writer, 'comment', obj.comment) 2415 if obj.description is not None: 2416 Writer.write_string(writer, 'description', obj.description) 2417 if obj.name is not None: 2418 Writer.write_string(writer, 'name', obj.name) 2419 if obj.user is not None: 2420 UserWriter.write_one(obj.user, writer, 'user') 2421 if obj.groups is not None: 2422 GroupWriter.write_many(obj.groups, writer, 'group', 'groups') 2423 if obj.users is not None: 2424 UserWriter.write_many(obj.users, writer, 'user', 'users') 2425 writer.write_end() 2426 2427 @staticmethod 2428 def write_many(objs, writer, singular=None, plural=None): 2429 if singular is None: 2430 singular = 'domain' 2431 if plural is None: 2432 plural = 'domains' 2433 writer.write_start(plural) 2434 if isinstance(objs, List): 2435 href = objs.href 2436 if href is not None: 2437 writer.write_attribute('href', href) 2438 for obj in objs: 2439 DomainWriter.write_one(obj, writer, singular) 2440 writer.write_end() 2441 2442 2443class DynamicCpuWriter(Writer): 2444 2445 def __init__(self): 2446 super(DynamicCpuWriter, self).__init__() 2447 2448 @staticmethod 2449 def write_one(obj, writer, singular=None): 2450 if singular is None: 2451 singular = 'dynamic_cpu' 2452 writer.write_start(singular) 2453 href = obj.href 2454 if href is not None: 2455 writer.write_attribute('href', href) 2456 if obj.cpu_tune is not None: 2457 CpuTuneWriter.write_one(obj.cpu_tune, writer, 'cpu_tune') 2458 if obj.topology is not None: 2459 CpuTopologyWriter.write_one(obj.topology, writer, 'topology') 2460 writer.write_end() 2461 2462 @staticmethod 2463 def write_many(objs, writer, singular=None, plural=None): 2464 if singular is None: 2465 singular = 'dynamic_cpu' 2466 if plural is None: 2467 plural = 'dynamic_cpus' 2468 writer.write_start(plural) 2469 if isinstance(objs, List): 2470 href = objs.href 2471 if href is not None: 2472 writer.write_attribute('href', href) 2473 for obj in objs: 2474 DynamicCpuWriter.write_one(obj, writer, singular) 2475 writer.write_end() 2476 2477 2478class EngineBackupInfoWriter(Writer): 2479 2480 def __init__(self): 2481 super(EngineBackupInfoWriter, self).__init__() 2482 2483 @staticmethod 2484 def write_one(obj, writer, singular=None): 2485 if singular is None: 2486 singular = 'engine_backup_info' 2487 writer.write_start(singular) 2488 href = obj.href 2489 if href is not None: 2490 writer.write_attribute('href', href) 2491 if obj.last_cinder_backup is not None: 2492 Writer.write_date(writer, 'last_cinder_backup', obj.last_cinder_backup) 2493 if obj.last_db_backup is not None: 2494 Writer.write_date(writer, 'last_db_backup', obj.last_db_backup) 2495 if obj.last_dwh_backup is not None: 2496 Writer.write_date(writer, 'last_dwh_backup', obj.last_dwh_backup) 2497 if obj.last_engine_backup is not None: 2498 Writer.write_date(writer, 'last_engine_backup', obj.last_engine_backup) 2499 if obj.last_grafana_backup is not None: 2500 Writer.write_date(writer, 'last_grafana_backup', obj.last_grafana_backup) 2501 if obj.last_keycloak_backup is not None: 2502 Writer.write_date(writer, 'last_keycloak_backup', obj.last_keycloak_backup) 2503 writer.write_end() 2504 2505 @staticmethod 2506 def write_many(objs, writer, singular=None, plural=None): 2507 if singular is None: 2508 singular = 'engine_backup_info' 2509 if plural is None: 2510 plural = 'engine_backup_infos' 2511 writer.write_start(plural) 2512 if isinstance(objs, List): 2513 href = objs.href 2514 if href is not None: 2515 writer.write_attribute('href', href) 2516 for obj in objs: 2517 EngineBackupInfoWriter.write_one(obj, writer, singular) 2518 writer.write_end() 2519 2520 2521class EntityProfileDetailWriter(Writer): 2522 2523 def __init__(self): 2524 super(EntityProfileDetailWriter, self).__init__() 2525 2526 @staticmethod 2527 def write_one(obj, writer, singular=None): 2528 if singular is None: 2529 singular = 'entity_profile_detail' 2530 writer.write_start(singular) 2531 href = obj.href 2532 if href is not None: 2533 writer.write_attribute('href', href) 2534 if obj.profile_details is not None: 2535 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 2536 writer.write_end() 2537 2538 @staticmethod 2539 def write_many(objs, writer, singular=None, plural=None): 2540 if singular is None: 2541 singular = 'entity_profile_detail' 2542 if plural is None: 2543 plural = 'entity_profile_details' 2544 writer.write_start(plural) 2545 if isinstance(objs, List): 2546 href = objs.href 2547 if href is not None: 2548 writer.write_attribute('href', href) 2549 for obj in objs: 2550 EntityProfileDetailWriter.write_one(obj, writer, singular) 2551 writer.write_end() 2552 2553 2554class ErrorHandlingWriter(Writer): 2555 2556 def __init__(self): 2557 super(ErrorHandlingWriter, self).__init__() 2558 2559 @staticmethod 2560 def write_one(obj, writer, singular=None): 2561 if singular is None: 2562 singular = 'error_handling' 2563 writer.write_start(singular) 2564 href = obj.href 2565 if href is not None: 2566 writer.write_attribute('href', href) 2567 if obj.on_error is not None: 2568 Writer.write_string(writer, 'on_error', obj.on_error.value) 2569 writer.write_end() 2570 2571 @staticmethod 2572 def write_many(objs, writer, singular=None, plural=None): 2573 if singular is None: 2574 singular = 'error_handling' 2575 if plural is None: 2576 plural = 'error_handlings' 2577 writer.write_start(plural) 2578 if isinstance(objs, List): 2579 href = objs.href 2580 if href is not None: 2581 writer.write_attribute('href', href) 2582 for obj in objs: 2583 ErrorHandlingWriter.write_one(obj, writer, singular) 2584 writer.write_end() 2585 2586 2587class EventWriter(Writer): 2588 2589 def __init__(self): 2590 super(EventWriter, self).__init__() 2591 2592 @staticmethod 2593 def write_one(obj, writer, singular=None): 2594 if singular is None: 2595 singular = 'event' 2596 writer.write_start(singular) 2597 href = obj.href 2598 if href is not None: 2599 writer.write_attribute('href', href) 2600 if obj.id is not None: 2601 writer.write_attribute('id', obj.id) 2602 if obj.code is not None: 2603 Writer.write_integer(writer, 'code', obj.code) 2604 if obj.comment is not None: 2605 Writer.write_string(writer, 'comment', obj.comment) 2606 if obj.correlation_id is not None: 2607 Writer.write_string(writer, 'correlation_id', obj.correlation_id) 2608 if obj.custom_data is not None: 2609 Writer.write_string(writer, 'custom_data', obj.custom_data) 2610 if obj.custom_id is not None: 2611 Writer.write_integer(writer, 'custom_id', obj.custom_id) 2612 if obj.description is not None: 2613 Writer.write_string(writer, 'description', obj.description) 2614 if obj.flood_rate is not None: 2615 Writer.write_integer(writer, 'flood_rate', obj.flood_rate) 2616 if obj.index is not None: 2617 Writer.write_integer(writer, 'index', obj.index) 2618 if obj.log_on_host is not None: 2619 Writer.write_boolean(writer, 'log_on_host', obj.log_on_host) 2620 if obj.name is not None: 2621 Writer.write_string(writer, 'name', obj.name) 2622 if obj.origin is not None: 2623 Writer.write_string(writer, 'origin', obj.origin) 2624 if obj.severity is not None: 2625 Writer.write_string(writer, 'severity', obj.severity.value) 2626 if obj.time is not None: 2627 Writer.write_date(writer, 'time', obj.time) 2628 if obj.cluster is not None: 2629 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 2630 if obj.data_center is not None: 2631 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 2632 if obj.host is not None: 2633 HostWriter.write_one(obj.host, writer, 'host') 2634 if obj.storage_domain is not None: 2635 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2636 if obj.template is not None: 2637 TemplateWriter.write_one(obj.template, writer, 'template') 2638 if obj.user is not None: 2639 UserWriter.write_one(obj.user, writer, 'user') 2640 if obj.vm is not None: 2641 VmWriter.write_one(obj.vm, writer, 'vm') 2642 writer.write_end() 2643 2644 @staticmethod 2645 def write_many(objs, writer, singular=None, plural=None): 2646 if singular is None: 2647 singular = 'event' 2648 if plural is None: 2649 plural = 'events' 2650 writer.write_start(plural) 2651 if isinstance(objs, List): 2652 href = objs.href 2653 if href is not None: 2654 writer.write_attribute('href', href) 2655 for obj in objs: 2656 EventWriter.write_one(obj, writer, singular) 2657 writer.write_end() 2658 2659 2660class EventSubscriptionWriter(Writer): 2661 2662 def __init__(self): 2663 super(EventSubscriptionWriter, self).__init__() 2664 2665 @staticmethod 2666 def write_one(obj, writer, singular=None): 2667 if singular is None: 2668 singular = 'event_subscription' 2669 writer.write_start(singular) 2670 href = obj.href 2671 if href is not None: 2672 writer.write_attribute('href', href) 2673 if obj.id is not None: 2674 writer.write_attribute('id', obj.id) 2675 if obj.address is not None: 2676 Writer.write_string(writer, 'address', obj.address) 2677 if obj.comment is not None: 2678 Writer.write_string(writer, 'comment', obj.comment) 2679 if obj.description is not None: 2680 Writer.write_string(writer, 'description', obj.description) 2681 if obj.event is not None: 2682 Writer.write_string(writer, 'event', obj.event.value) 2683 if obj.name is not None: 2684 Writer.write_string(writer, 'name', obj.name) 2685 if obj.notification_method is not None: 2686 Writer.write_string(writer, 'notification_method', obj.notification_method.value) 2687 if obj.user is not None: 2688 UserWriter.write_one(obj.user, writer, 'user') 2689 writer.write_end() 2690 2691 @staticmethod 2692 def write_many(objs, writer, singular=None, plural=None): 2693 if singular is None: 2694 singular = 'event_subscription' 2695 if plural is None: 2696 plural = 'event_subscriptions' 2697 writer.write_start(plural) 2698 if isinstance(objs, List): 2699 href = objs.href 2700 if href is not None: 2701 writer.write_attribute('href', href) 2702 for obj in objs: 2703 EventSubscriptionWriter.write_one(obj, writer, singular) 2704 writer.write_end() 2705 2706 2707class ExternalComputeResourceWriter(Writer): 2708 2709 def __init__(self): 2710 super(ExternalComputeResourceWriter, self).__init__() 2711 2712 @staticmethod 2713 def write_one(obj, writer, singular=None): 2714 if singular is None: 2715 singular = 'external_compute_resource' 2716 writer.write_start(singular) 2717 href = obj.href 2718 if href is not None: 2719 writer.write_attribute('href', href) 2720 if obj.id is not None: 2721 writer.write_attribute('id', obj.id) 2722 if obj.comment is not None: 2723 Writer.write_string(writer, 'comment', obj.comment) 2724 if obj.description is not None: 2725 Writer.write_string(writer, 'description', obj.description) 2726 if obj.name is not None: 2727 Writer.write_string(writer, 'name', obj.name) 2728 if obj.provider is not None: 2729 Writer.write_string(writer, 'provider', obj.provider) 2730 if obj.url is not None: 2731 Writer.write_string(writer, 'url', obj.url) 2732 if obj.user is not None: 2733 Writer.write_string(writer, 'user', obj.user) 2734 if obj.external_host_provider is not None: 2735 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2736 writer.write_end() 2737 2738 @staticmethod 2739 def write_many(objs, writer, singular=None, plural=None): 2740 if singular is None: 2741 singular = 'external_compute_resource' 2742 if plural is None: 2743 plural = 'external_compute_resources' 2744 writer.write_start(plural) 2745 if isinstance(objs, List): 2746 href = objs.href 2747 if href is not None: 2748 writer.write_attribute('href', href) 2749 for obj in objs: 2750 ExternalComputeResourceWriter.write_one(obj, writer, singular) 2751 writer.write_end() 2752 2753 2754class ExternalDiscoveredHostWriter(Writer): 2755 2756 def __init__(self): 2757 super(ExternalDiscoveredHostWriter, self).__init__() 2758 2759 @staticmethod 2760 def write_one(obj, writer, singular=None): 2761 if singular is None: 2762 singular = 'external_discovered_host' 2763 writer.write_start(singular) 2764 href = obj.href 2765 if href is not None: 2766 writer.write_attribute('href', href) 2767 if obj.id is not None: 2768 writer.write_attribute('id', obj.id) 2769 if obj.comment is not None: 2770 Writer.write_string(writer, 'comment', obj.comment) 2771 if obj.description is not None: 2772 Writer.write_string(writer, 'description', obj.description) 2773 if obj.ip is not None: 2774 Writer.write_string(writer, 'ip', obj.ip) 2775 if obj.last_report is not None: 2776 Writer.write_string(writer, 'last_report', obj.last_report) 2777 if obj.mac is not None: 2778 Writer.write_string(writer, 'mac', obj.mac) 2779 if obj.name is not None: 2780 Writer.write_string(writer, 'name', obj.name) 2781 if obj.subnet_name is not None: 2782 Writer.write_string(writer, 'subnet_name', obj.subnet_name) 2783 if obj.external_host_provider is not None: 2784 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2785 writer.write_end() 2786 2787 @staticmethod 2788 def write_many(objs, writer, singular=None, plural=None): 2789 if singular is None: 2790 singular = 'external_discovered_host' 2791 if plural is None: 2792 plural = 'external_discovered_hosts' 2793 writer.write_start(plural) 2794 if isinstance(objs, List): 2795 href = objs.href 2796 if href is not None: 2797 writer.write_attribute('href', href) 2798 for obj in objs: 2799 ExternalDiscoveredHostWriter.write_one(obj, writer, singular) 2800 writer.write_end() 2801 2802 2803class ExternalHostWriter(Writer): 2804 2805 def __init__(self): 2806 super(ExternalHostWriter, self).__init__() 2807 2808 @staticmethod 2809 def write_one(obj, writer, singular=None): 2810 if singular is None: 2811 singular = 'external_host' 2812 writer.write_start(singular) 2813 href = obj.href 2814 if href is not None: 2815 writer.write_attribute('href', href) 2816 if obj.id is not None: 2817 writer.write_attribute('id', obj.id) 2818 if obj.address is not None: 2819 Writer.write_string(writer, 'address', obj.address) 2820 if obj.comment is not None: 2821 Writer.write_string(writer, 'comment', obj.comment) 2822 if obj.description is not None: 2823 Writer.write_string(writer, 'description', obj.description) 2824 if obj.name is not None: 2825 Writer.write_string(writer, 'name', obj.name) 2826 if obj.external_host_provider is not None: 2827 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2828 writer.write_end() 2829 2830 @staticmethod 2831 def write_many(objs, writer, singular=None, plural=None): 2832 if singular is None: 2833 singular = 'external_host' 2834 if plural is None: 2835 plural = 'external_hosts' 2836 writer.write_start(plural) 2837 if isinstance(objs, List): 2838 href = objs.href 2839 if href is not None: 2840 writer.write_attribute('href', href) 2841 for obj in objs: 2842 ExternalHostWriter.write_one(obj, writer, singular) 2843 writer.write_end() 2844 2845 2846class ExternalHostGroupWriter(Writer): 2847 2848 def __init__(self): 2849 super(ExternalHostGroupWriter, self).__init__() 2850 2851 @staticmethod 2852 def write_one(obj, writer, singular=None): 2853 if singular is None: 2854 singular = 'external_host_group' 2855 writer.write_start(singular) 2856 href = obj.href 2857 if href is not None: 2858 writer.write_attribute('href', href) 2859 if obj.id is not None: 2860 writer.write_attribute('id', obj.id) 2861 if obj.architecture_name is not None: 2862 Writer.write_string(writer, 'architecture_name', obj.architecture_name) 2863 if obj.comment is not None: 2864 Writer.write_string(writer, 'comment', obj.comment) 2865 if obj.description is not None: 2866 Writer.write_string(writer, 'description', obj.description) 2867 if obj.domain_name is not None: 2868 Writer.write_string(writer, 'domain_name', obj.domain_name) 2869 if obj.name is not None: 2870 Writer.write_string(writer, 'name', obj.name) 2871 if obj.operating_system_name is not None: 2872 Writer.write_string(writer, 'operating_system_name', obj.operating_system_name) 2873 if obj.subnet_name is not None: 2874 Writer.write_string(writer, 'subnet_name', obj.subnet_name) 2875 if obj.external_host_provider is not None: 2876 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2877 writer.write_end() 2878 2879 @staticmethod 2880 def write_many(objs, writer, singular=None, plural=None): 2881 if singular is None: 2882 singular = 'external_host_group' 2883 if plural is None: 2884 plural = 'external_host_groups' 2885 writer.write_start(plural) 2886 if isinstance(objs, List): 2887 href = objs.href 2888 if href is not None: 2889 writer.write_attribute('href', href) 2890 for obj in objs: 2891 ExternalHostGroupWriter.write_one(obj, writer, singular) 2892 writer.write_end() 2893 2894 2895class ExternalHostProviderWriter(Writer): 2896 2897 def __init__(self): 2898 super(ExternalHostProviderWriter, self).__init__() 2899 2900 @staticmethod 2901 def write_one(obj, writer, singular=None): 2902 if singular is None: 2903 singular = 'external_host_provider' 2904 writer.write_start(singular) 2905 href = obj.href 2906 if href is not None: 2907 writer.write_attribute('href', href) 2908 if obj.id is not None: 2909 writer.write_attribute('id', obj.id) 2910 if obj.authentication_url is not None: 2911 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 2912 if obj.comment is not None: 2913 Writer.write_string(writer, 'comment', obj.comment) 2914 if obj.description is not None: 2915 Writer.write_string(writer, 'description', obj.description) 2916 if obj.name is not None: 2917 Writer.write_string(writer, 'name', obj.name) 2918 if obj.password is not None: 2919 Writer.write_string(writer, 'password', obj.password) 2920 if obj.properties is not None: 2921 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 2922 if obj.requires_authentication is not None: 2923 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 2924 if obj.url is not None: 2925 Writer.write_string(writer, 'url', obj.url) 2926 if obj.username is not None: 2927 Writer.write_string(writer, 'username', obj.username) 2928 if obj.certificates is not None: 2929 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 2930 if obj.compute_resources is not None: 2931 ExternalComputeResourceWriter.write_many(obj.compute_resources, writer, 'external_compute_resource', 'compute_resources') 2932 if obj.discovered_hosts is not None: 2933 ExternalDiscoveredHostWriter.write_many(obj.discovered_hosts, writer, 'external_discovered_host', 'discovered_hosts') 2934 if obj.host_groups is not None: 2935 ExternalHostGroupWriter.write_many(obj.host_groups, writer, 'external_host_group', 'host_groups') 2936 if obj.hosts is not None: 2937 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 2938 writer.write_end() 2939 2940 @staticmethod 2941 def write_many(objs, writer, singular=None, plural=None): 2942 if singular is None: 2943 singular = 'external_host_provider' 2944 if plural is None: 2945 plural = 'external_host_providers' 2946 writer.write_start(plural) 2947 if isinstance(objs, List): 2948 href = objs.href 2949 if href is not None: 2950 writer.write_attribute('href', href) 2951 for obj in objs: 2952 ExternalHostProviderWriter.write_one(obj, writer, singular) 2953 writer.write_end() 2954 2955 2956class ExternalNetworkProviderConfigurationWriter(Writer): 2957 2958 def __init__(self): 2959 super(ExternalNetworkProviderConfigurationWriter, self).__init__() 2960 2961 @staticmethod 2962 def write_one(obj, writer, singular=None): 2963 if singular is None: 2964 singular = 'external_network_provider_configuration' 2965 writer.write_start(singular) 2966 href = obj.href 2967 if href is not None: 2968 writer.write_attribute('href', href) 2969 if obj.id is not None: 2970 writer.write_attribute('id', obj.id) 2971 if obj.comment is not None: 2972 Writer.write_string(writer, 'comment', obj.comment) 2973 if obj.description is not None: 2974 Writer.write_string(writer, 'description', obj.description) 2975 if obj.name is not None: 2976 Writer.write_string(writer, 'name', obj.name) 2977 if obj.external_network_provider is not None: 2978 ExternalProviderWriter.write_one(obj.external_network_provider, writer, 'external_network_provider') 2979 if obj.host is not None: 2980 HostWriter.write_one(obj.host, writer, 'host') 2981 writer.write_end() 2982 2983 @staticmethod 2984 def write_many(objs, writer, singular=None, plural=None): 2985 if singular is None: 2986 singular = 'external_network_provider_configuration' 2987 if plural is None: 2988 plural = 'external_network_provider_configurations' 2989 writer.write_start(plural) 2990 if isinstance(objs, List): 2991 href = objs.href 2992 if href is not None: 2993 writer.write_attribute('href', href) 2994 for obj in objs: 2995 ExternalNetworkProviderConfigurationWriter.write_one(obj, writer, singular) 2996 writer.write_end() 2997 2998 2999class ExternalProviderWriter(Writer): 3000 3001 def __init__(self): 3002 super(ExternalProviderWriter, self).__init__() 3003 3004 @staticmethod 3005 def write_one(obj, writer, singular=None): 3006 if singular is None: 3007 singular = 'external_provider' 3008 writer.write_start(singular) 3009 href = obj.href 3010 if href is not None: 3011 writer.write_attribute('href', href) 3012 if obj.id is not None: 3013 writer.write_attribute('id', obj.id) 3014 if obj.authentication_url is not None: 3015 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 3016 if obj.comment is not None: 3017 Writer.write_string(writer, 'comment', obj.comment) 3018 if obj.description is not None: 3019 Writer.write_string(writer, 'description', obj.description) 3020 if obj.name is not None: 3021 Writer.write_string(writer, 'name', obj.name) 3022 if obj.password is not None: 3023 Writer.write_string(writer, 'password', obj.password) 3024 if obj.properties is not None: 3025 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 3026 if obj.requires_authentication is not None: 3027 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 3028 if obj.url is not None: 3029 Writer.write_string(writer, 'url', obj.url) 3030 if obj.username is not None: 3031 Writer.write_string(writer, 'username', obj.username) 3032 writer.write_end() 3033 3034 @staticmethod 3035 def write_many(objs, writer, singular=None, plural=None): 3036 if singular is None: 3037 singular = 'external_provider' 3038 if plural is None: 3039 plural = 'external_providers' 3040 writer.write_start(plural) 3041 if isinstance(objs, List): 3042 href = objs.href 3043 if href is not None: 3044 writer.write_attribute('href', href) 3045 for obj in objs: 3046 ExternalProviderWriter.write_one(obj, writer, singular) 3047 writer.write_end() 3048 3049 3050class ExternalTemplateImportWriter(Writer): 3051 3052 def __init__(self): 3053 super(ExternalTemplateImportWriter, self).__init__() 3054 3055 @staticmethod 3056 def write_one(obj, writer, singular=None): 3057 if singular is None: 3058 singular = 'external_template_import' 3059 writer.write_start(singular) 3060 href = obj.href 3061 if href is not None: 3062 writer.write_attribute('href', href) 3063 if obj.clone is not None: 3064 Writer.write_boolean(writer, 'clone', obj.clone) 3065 if obj.url is not None: 3066 Writer.write_string(writer, 'url', obj.url) 3067 if obj.cluster is not None: 3068 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3069 if obj.cpu_profile is not None: 3070 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 3071 if obj.host is not None: 3072 HostWriter.write_one(obj.host, writer, 'host') 3073 if obj.quota is not None: 3074 QuotaWriter.write_one(obj.quota, writer, 'quota') 3075 if obj.storage_domain is not None: 3076 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3077 if obj.template is not None: 3078 TemplateWriter.write_one(obj.template, writer, 'template') 3079 writer.write_end() 3080 3081 @staticmethod 3082 def write_many(objs, writer, singular=None, plural=None): 3083 if singular is None: 3084 singular = 'external_template_import' 3085 if plural is None: 3086 plural = 'external_template_imports' 3087 writer.write_start(plural) 3088 if isinstance(objs, List): 3089 href = objs.href 3090 if href is not None: 3091 writer.write_attribute('href', href) 3092 for obj in objs: 3093 ExternalTemplateImportWriter.write_one(obj, writer, singular) 3094 writer.write_end() 3095 3096 3097class ExternalVmImportWriter(Writer): 3098 3099 def __init__(self): 3100 super(ExternalVmImportWriter, self).__init__() 3101 3102 @staticmethod 3103 def write_one(obj, writer, singular=None): 3104 if singular is None: 3105 singular = 'external_vm_import' 3106 writer.write_start(singular) 3107 href = obj.href 3108 if href is not None: 3109 writer.write_attribute('href', href) 3110 if obj.name is not None: 3111 Writer.write_string(writer, 'name', obj.name) 3112 if obj.password is not None: 3113 Writer.write_string(writer, 'password', obj.password) 3114 if obj.provider is not None: 3115 Writer.write_string(writer, 'provider', obj.provider.value) 3116 if obj.sparse is not None: 3117 Writer.write_boolean(writer, 'sparse', obj.sparse) 3118 if obj.url is not None: 3119 Writer.write_string(writer, 'url', obj.url) 3120 if obj.username is not None: 3121 Writer.write_string(writer, 'username', obj.username) 3122 if obj.cluster is not None: 3123 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3124 if obj.cpu_profile is not None: 3125 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 3126 if obj.drivers_iso is not None: 3127 FileWriter.write_one(obj.drivers_iso, writer, 'drivers_iso') 3128 if obj.host is not None: 3129 HostWriter.write_one(obj.host, writer, 'host') 3130 if obj.quota is not None: 3131 QuotaWriter.write_one(obj.quota, writer, 'quota') 3132 if obj.storage_domain is not None: 3133 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3134 if obj.vm is not None: 3135 VmWriter.write_one(obj.vm, writer, 'vm') 3136 writer.write_end() 3137 3138 @staticmethod 3139 def write_many(objs, writer, singular=None, plural=None): 3140 if singular is None: 3141 singular = 'external_vm_import' 3142 if plural is None: 3143 plural = 'external_vm_imports' 3144 writer.write_start(plural) 3145 if isinstance(objs, List): 3146 href = objs.href 3147 if href is not None: 3148 writer.write_attribute('href', href) 3149 for obj in objs: 3150 ExternalVmImportWriter.write_one(obj, writer, singular) 3151 writer.write_end() 3152 3153 3154class FaultWriter(Writer): 3155 3156 def __init__(self): 3157 super(FaultWriter, self).__init__() 3158 3159 @staticmethod 3160 def write_one(obj, writer, singular=None): 3161 if singular is None: 3162 singular = 'fault' 3163 writer.write_start(singular) 3164 href = obj.href 3165 if href is not None: 3166 writer.write_attribute('href', href) 3167 if obj.detail is not None: 3168 Writer.write_string(writer, 'detail', obj.detail) 3169 if obj.reason is not None: 3170 Writer.write_string(writer, 'reason', obj.reason) 3171 writer.write_end() 3172 3173 @staticmethod 3174 def write_many(objs, writer, singular=None, plural=None): 3175 if singular is None: 3176 singular = 'fault' 3177 if plural is None: 3178 plural = 'faults' 3179 writer.write_start(plural) 3180 if isinstance(objs, List): 3181 href = objs.href 3182 if href is not None: 3183 writer.write_attribute('href', href) 3184 for obj in objs: 3185 FaultWriter.write_one(obj, writer, singular) 3186 writer.write_end() 3187 3188 3189class FencingPolicyWriter(Writer): 3190 3191 def __init__(self): 3192 super(FencingPolicyWriter, self).__init__() 3193 3194 @staticmethod 3195 def write_one(obj, writer, singular=None): 3196 if singular is None: 3197 singular = 'fencing_policy' 3198 writer.write_start(singular) 3199 href = obj.href 3200 if href is not None: 3201 writer.write_attribute('href', href) 3202 if obj.enabled is not None: 3203 Writer.write_boolean(writer, 'enabled', obj.enabled) 3204 if obj.skip_if_connectivity_broken is not None: 3205 SkipIfConnectivityBrokenWriter.write_one(obj.skip_if_connectivity_broken, writer, 'skip_if_connectivity_broken') 3206 if obj.skip_if_gluster_bricks_up is not None: 3207 Writer.write_boolean(writer, 'skip_if_gluster_bricks_up', obj.skip_if_gluster_bricks_up) 3208 if obj.skip_if_gluster_quorum_not_met is not None: 3209 Writer.write_boolean(writer, 'skip_if_gluster_quorum_not_met', obj.skip_if_gluster_quorum_not_met) 3210 if obj.skip_if_sd_active is not None: 3211 SkipIfSdActiveWriter.write_one(obj.skip_if_sd_active, writer, 'skip_if_sd_active') 3212 writer.write_end() 3213 3214 @staticmethod 3215 def write_many(objs, writer, singular=None, plural=None): 3216 if singular is None: 3217 singular = 'fencing_policy' 3218 if plural is None: 3219 plural = 'fencing_policies' 3220 writer.write_start(plural) 3221 if isinstance(objs, List): 3222 href = objs.href 3223 if href is not None: 3224 writer.write_attribute('href', href) 3225 for obj in objs: 3226 FencingPolicyWriter.write_one(obj, writer, singular) 3227 writer.write_end() 3228 3229 3230class FileWriter(Writer): 3231 3232 def __init__(self): 3233 super(FileWriter, self).__init__() 3234 3235 @staticmethod 3236 def write_one(obj, writer, singular=None): 3237 if singular is None: 3238 singular = 'file' 3239 writer.write_start(singular) 3240 href = obj.href 3241 if href is not None: 3242 writer.write_attribute('href', href) 3243 if obj.id is not None: 3244 writer.write_attribute('id', obj.id) 3245 if obj.comment is not None: 3246 Writer.write_string(writer, 'comment', obj.comment) 3247 if obj.content is not None: 3248 Writer.write_string(writer, 'content', obj.content) 3249 if obj.description is not None: 3250 Writer.write_string(writer, 'description', obj.description) 3251 if obj.name is not None: 3252 Writer.write_string(writer, 'name', obj.name) 3253 if obj.type is not None: 3254 Writer.write_string(writer, 'type', obj.type) 3255 if obj.storage_domain is not None: 3256 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3257 writer.write_end() 3258 3259 @staticmethod 3260 def write_many(objs, writer, singular=None, plural=None): 3261 if singular is None: 3262 singular = 'file' 3263 if plural is None: 3264 plural = 'files' 3265 writer.write_start(plural) 3266 if isinstance(objs, List): 3267 href = objs.href 3268 if href is not None: 3269 writer.write_attribute('href', href) 3270 for obj in objs: 3271 FileWriter.write_one(obj, writer, singular) 3272 writer.write_end() 3273 3274 3275class FilterWriter(Writer): 3276 3277 def __init__(self): 3278 super(FilterWriter, self).__init__() 3279 3280 @staticmethod 3281 def write_one(obj, writer, singular=None): 3282 if singular is None: 3283 singular = 'filter' 3284 writer.write_start(singular) 3285 href = obj.href 3286 if href is not None: 3287 writer.write_attribute('href', href) 3288 if obj.id is not None: 3289 writer.write_attribute('id', obj.id) 3290 if obj.comment is not None: 3291 Writer.write_string(writer, 'comment', obj.comment) 3292 if obj.description is not None: 3293 Writer.write_string(writer, 'description', obj.description) 3294 if obj.name is not None: 3295 Writer.write_string(writer, 'name', obj.name) 3296 if obj.position is not None: 3297 Writer.write_integer(writer, 'position', obj.position) 3298 if obj.scheduling_policy_unit is not None: 3299 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 3300 writer.write_end() 3301 3302 @staticmethod 3303 def write_many(objs, writer, singular=None, plural=None): 3304 if singular is None: 3305 singular = 'filter' 3306 if plural is None: 3307 plural = 'filters' 3308 writer.write_start(plural) 3309 if isinstance(objs, List): 3310 href = objs.href 3311 if href is not None: 3312 writer.write_attribute('href', href) 3313 for obj in objs: 3314 FilterWriter.write_one(obj, writer, singular) 3315 writer.write_end() 3316 3317 3318class FloppyWriter(Writer): 3319 3320 def __init__(self): 3321 super(FloppyWriter, self).__init__() 3322 3323 @staticmethod 3324 def write_one(obj, writer, singular=None): 3325 if singular is None: 3326 singular = 'floppy' 3327 writer.write_start(singular) 3328 href = obj.href 3329 if href is not None: 3330 writer.write_attribute('href', href) 3331 if obj.id is not None: 3332 writer.write_attribute('id', obj.id) 3333 if obj.comment is not None: 3334 Writer.write_string(writer, 'comment', obj.comment) 3335 if obj.description is not None: 3336 Writer.write_string(writer, 'description', obj.description) 3337 if obj.file is not None: 3338 FileWriter.write_one(obj.file, writer, 'file') 3339 if obj.name is not None: 3340 Writer.write_string(writer, 'name', obj.name) 3341 if obj.instance_type is not None: 3342 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3343 if obj.template is not None: 3344 TemplateWriter.write_one(obj.template, writer, 'template') 3345 if obj.vm is not None: 3346 VmWriter.write_one(obj.vm, writer, 'vm') 3347 if obj.vms is not None: 3348 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3349 writer.write_end() 3350 3351 @staticmethod 3352 def write_many(objs, writer, singular=None, plural=None): 3353 if singular is None: 3354 singular = 'floppy' 3355 if plural is None: 3356 plural = 'floppies' 3357 writer.write_start(plural) 3358 if isinstance(objs, List): 3359 href = objs.href 3360 if href is not None: 3361 writer.write_attribute('href', href) 3362 for obj in objs: 3363 FloppyWriter.write_one(obj, writer, singular) 3364 writer.write_end() 3365 3366 3367class FopStatisticWriter(Writer): 3368 3369 def __init__(self): 3370 super(FopStatisticWriter, self).__init__() 3371 3372 @staticmethod 3373 def write_one(obj, writer, singular=None): 3374 if singular is None: 3375 singular = 'fop_statistic' 3376 writer.write_start(singular) 3377 href = obj.href 3378 if href is not None: 3379 writer.write_attribute('href', href) 3380 if obj.name is not None: 3381 Writer.write_string(writer, 'name', obj.name) 3382 if obj.statistics is not None: 3383 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3384 writer.write_end() 3385 3386 @staticmethod 3387 def write_many(objs, writer, singular=None, plural=None): 3388 if singular is None: 3389 singular = 'fop_statistic' 3390 if plural is None: 3391 plural = 'fop_statistics' 3392 writer.write_start(plural) 3393 if isinstance(objs, List): 3394 href = objs.href 3395 if href is not None: 3396 writer.write_attribute('href', href) 3397 for obj in objs: 3398 FopStatisticWriter.write_one(obj, writer, singular) 3399 writer.write_end() 3400 3401 3402class GlusterBrickWriter(Writer): 3403 3404 def __init__(self): 3405 super(GlusterBrickWriter, self).__init__() 3406 3407 @staticmethod 3408 def write_one(obj, writer, singular=None): 3409 if singular is None: 3410 singular = 'brick' 3411 writer.write_start(singular) 3412 href = obj.href 3413 if href is not None: 3414 writer.write_attribute('href', href) 3415 if obj.id is not None: 3416 writer.write_attribute('id', obj.id) 3417 if obj.brick_dir is not None: 3418 Writer.write_string(writer, 'brick_dir', obj.brick_dir) 3419 if obj.comment is not None: 3420 Writer.write_string(writer, 'comment', obj.comment) 3421 if obj.description is not None: 3422 Writer.write_string(writer, 'description', obj.description) 3423 if obj.device is not None: 3424 Writer.write_string(writer, 'device', obj.device) 3425 if obj.fs_name is not None: 3426 Writer.write_string(writer, 'fs_name', obj.fs_name) 3427 if obj.gluster_clients is not None: 3428 GlusterClientWriter.write_many(obj.gluster_clients, writer, 'gluster_client', 'gluster_clients') 3429 if obj.memory_pools is not None: 3430 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3431 if obj.mnt_options is not None: 3432 Writer.write_string(writer, 'mnt_options', obj.mnt_options) 3433 if obj.name is not None: 3434 Writer.write_string(writer, 'name', obj.name) 3435 if obj.pid is not None: 3436 Writer.write_integer(writer, 'pid', obj.pid) 3437 if obj.port is not None: 3438 Writer.write_integer(writer, 'port', obj.port) 3439 if obj.server_id is not None: 3440 Writer.write_string(writer, 'server_id', obj.server_id) 3441 if obj.status is not None: 3442 Writer.write_string(writer, 'status', obj.status.value) 3443 if obj.gluster_volume is not None: 3444 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 3445 if obj.instance_type is not None: 3446 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3447 if obj.statistics is not None: 3448 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3449 if obj.template is not None: 3450 TemplateWriter.write_one(obj.template, writer, 'template') 3451 if obj.vm is not None: 3452 VmWriter.write_one(obj.vm, writer, 'vm') 3453 if obj.vms is not None: 3454 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3455 writer.write_end() 3456 3457 @staticmethod 3458 def write_many(objs, writer, singular=None, plural=None): 3459 if singular is None: 3460 singular = 'brick' 3461 if plural is None: 3462 plural = 'bricks' 3463 writer.write_start(plural) 3464 if isinstance(objs, List): 3465 href = objs.href 3466 if href is not None: 3467 writer.write_attribute('href', href) 3468 for obj in objs: 3469 GlusterBrickWriter.write_one(obj, writer, singular) 3470 writer.write_end() 3471 3472 3473class GlusterBrickAdvancedDetailsWriter(Writer): 3474 3475 def __init__(self): 3476 super(GlusterBrickAdvancedDetailsWriter, self).__init__() 3477 3478 @staticmethod 3479 def write_one(obj, writer, singular=None): 3480 if singular is None: 3481 singular = 'gluster_brick_advanced_details' 3482 writer.write_start(singular) 3483 href = obj.href 3484 if href is not None: 3485 writer.write_attribute('href', href) 3486 if obj.id is not None: 3487 writer.write_attribute('id', obj.id) 3488 if obj.comment is not None: 3489 Writer.write_string(writer, 'comment', obj.comment) 3490 if obj.description is not None: 3491 Writer.write_string(writer, 'description', obj.description) 3492 if obj.device is not None: 3493 Writer.write_string(writer, 'device', obj.device) 3494 if obj.fs_name is not None: 3495 Writer.write_string(writer, 'fs_name', obj.fs_name) 3496 if obj.gluster_clients is not None: 3497 GlusterClientWriter.write_many(obj.gluster_clients, writer, 'gluster_client', 'gluster_clients') 3498 if obj.memory_pools is not None: 3499 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3500 if obj.mnt_options is not None: 3501 Writer.write_string(writer, 'mnt_options', obj.mnt_options) 3502 if obj.name is not None: 3503 Writer.write_string(writer, 'name', obj.name) 3504 if obj.pid is not None: 3505 Writer.write_integer(writer, 'pid', obj.pid) 3506 if obj.port is not None: 3507 Writer.write_integer(writer, 'port', obj.port) 3508 if obj.instance_type is not None: 3509 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3510 if obj.template is not None: 3511 TemplateWriter.write_one(obj.template, writer, 'template') 3512 if obj.vm is not None: 3513 VmWriter.write_one(obj.vm, writer, 'vm') 3514 if obj.vms is not None: 3515 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3516 writer.write_end() 3517 3518 @staticmethod 3519 def write_many(objs, writer, singular=None, plural=None): 3520 if singular is None: 3521 singular = 'gluster_brick_advanced_details' 3522 if plural is None: 3523 plural = 'gluster_brick_advanced_detailss' 3524 writer.write_start(plural) 3525 if isinstance(objs, List): 3526 href = objs.href 3527 if href is not None: 3528 writer.write_attribute('href', href) 3529 for obj in objs: 3530 GlusterBrickAdvancedDetailsWriter.write_one(obj, writer, singular) 3531 writer.write_end() 3532 3533 3534class GlusterBrickMemoryInfoWriter(Writer): 3535 3536 def __init__(self): 3537 super(GlusterBrickMemoryInfoWriter, self).__init__() 3538 3539 @staticmethod 3540 def write_one(obj, writer, singular=None): 3541 if singular is None: 3542 singular = 'brick_memoryinfo' 3543 writer.write_start(singular) 3544 href = obj.href 3545 if href is not None: 3546 writer.write_attribute('href', href) 3547 if obj.memory_pools is not None: 3548 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3549 writer.write_end() 3550 3551 @staticmethod 3552 def write_many(objs, writer, singular=None, plural=None): 3553 if singular is None: 3554 singular = 'brick_memoryinfo' 3555 if plural is None: 3556 plural = 'gluster_brick_memory_infos' 3557 writer.write_start(plural) 3558 if isinstance(objs, List): 3559 href = objs.href 3560 if href is not None: 3561 writer.write_attribute('href', href) 3562 for obj in objs: 3563 GlusterBrickMemoryInfoWriter.write_one(obj, writer, singular) 3564 writer.write_end() 3565 3566 3567class GlusterClientWriter(Writer): 3568 3569 def __init__(self): 3570 super(GlusterClientWriter, self).__init__() 3571 3572 @staticmethod 3573 def write_one(obj, writer, singular=None): 3574 if singular is None: 3575 singular = 'gluster_client' 3576 writer.write_start(singular) 3577 href = obj.href 3578 if href is not None: 3579 writer.write_attribute('href', href) 3580 if obj.bytes_read is not None: 3581 Writer.write_integer(writer, 'bytes_read', obj.bytes_read) 3582 if obj.bytes_written is not None: 3583 Writer.write_integer(writer, 'bytes_written', obj.bytes_written) 3584 if obj.client_port is not None: 3585 Writer.write_integer(writer, 'client_port', obj.client_port) 3586 if obj.host_name is not None: 3587 Writer.write_string(writer, 'host_name', obj.host_name) 3588 writer.write_end() 3589 3590 @staticmethod 3591 def write_many(objs, writer, singular=None, plural=None): 3592 if singular is None: 3593 singular = 'gluster_client' 3594 if plural is None: 3595 plural = 'gluster_clients' 3596 writer.write_start(plural) 3597 if isinstance(objs, List): 3598 href = objs.href 3599 if href is not None: 3600 writer.write_attribute('href', href) 3601 for obj in objs: 3602 GlusterClientWriter.write_one(obj, writer, singular) 3603 writer.write_end() 3604 3605 3606class GlusterHookWriter(Writer): 3607 3608 def __init__(self): 3609 super(GlusterHookWriter, self).__init__() 3610 3611 @staticmethod 3612 def write_one(obj, writer, singular=None): 3613 if singular is None: 3614 singular = 'gluster_hook' 3615 writer.write_start(singular) 3616 href = obj.href 3617 if href is not None: 3618 writer.write_attribute('href', href) 3619 if obj.id is not None: 3620 writer.write_attribute('id', obj.id) 3621 if obj.checksum is not None: 3622 Writer.write_string(writer, 'checksum', obj.checksum) 3623 if obj.comment is not None: 3624 Writer.write_string(writer, 'comment', obj.comment) 3625 if obj.conflict_status is not None: 3626 Writer.write_integer(writer, 'conflict_status', obj.conflict_status) 3627 if obj.conflicts is not None: 3628 Writer.write_string(writer, 'conflicts', obj.conflicts) 3629 if obj.content is not None: 3630 Writer.write_string(writer, 'content', obj.content) 3631 if obj.content_type is not None: 3632 Writer.write_string(writer, 'content_type', obj.content_type.value) 3633 if obj.description is not None: 3634 Writer.write_string(writer, 'description', obj.description) 3635 if obj.gluster_command is not None: 3636 Writer.write_string(writer, 'gluster_command', obj.gluster_command) 3637 if obj.name is not None: 3638 Writer.write_string(writer, 'name', obj.name) 3639 if obj.stage is not None: 3640 Writer.write_string(writer, 'stage', obj.stage.value) 3641 if obj.status is not None: 3642 Writer.write_string(writer, 'status', obj.status.value) 3643 if obj.cluster is not None: 3644 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3645 if obj.server_hooks is not None: 3646 GlusterServerHookWriter.write_many(obj.server_hooks, writer, 'server_hook', 'server_hooks') 3647 writer.write_end() 3648 3649 @staticmethod 3650 def write_many(objs, writer, singular=None, plural=None): 3651 if singular is None: 3652 singular = 'gluster_hook' 3653 if plural is None: 3654 plural = 'gluster_hooks' 3655 writer.write_start(plural) 3656 if isinstance(objs, List): 3657 href = objs.href 3658 if href is not None: 3659 writer.write_attribute('href', href) 3660 for obj in objs: 3661 GlusterHookWriter.write_one(obj, writer, singular) 3662 writer.write_end() 3663 3664 3665class GlusterMemoryPoolWriter(Writer): 3666 3667 def __init__(self): 3668 super(GlusterMemoryPoolWriter, self).__init__() 3669 3670 @staticmethod 3671 def write_one(obj, writer, singular=None): 3672 if singular is None: 3673 singular = 'memory_pool' 3674 writer.write_start(singular) 3675 href = obj.href 3676 if href is not None: 3677 writer.write_attribute('href', href) 3678 if obj.id is not None: 3679 writer.write_attribute('id', obj.id) 3680 if obj.alloc_count is not None: 3681 Writer.write_integer(writer, 'alloc_count', obj.alloc_count) 3682 if obj.cold_count is not None: 3683 Writer.write_integer(writer, 'cold_count', obj.cold_count) 3684 if obj.comment is not None: 3685 Writer.write_string(writer, 'comment', obj.comment) 3686 if obj.description is not None: 3687 Writer.write_string(writer, 'description', obj.description) 3688 if obj.hot_count is not None: 3689 Writer.write_integer(writer, 'hot_count', obj.hot_count) 3690 if obj.max_alloc is not None: 3691 Writer.write_integer(writer, 'max_alloc', obj.max_alloc) 3692 if obj.max_stdalloc is not None: 3693 Writer.write_integer(writer, 'max_stdalloc', obj.max_stdalloc) 3694 if obj.name is not None: 3695 Writer.write_string(writer, 'name', obj.name) 3696 if obj.padded_size is not None: 3697 Writer.write_integer(writer, 'padded_size', obj.padded_size) 3698 if obj.pool_misses is not None: 3699 Writer.write_integer(writer, 'pool_misses', obj.pool_misses) 3700 if obj.type is not None: 3701 Writer.write_string(writer, 'type', obj.type) 3702 writer.write_end() 3703 3704 @staticmethod 3705 def write_many(objs, writer, singular=None, plural=None): 3706 if singular is None: 3707 singular = 'memory_pool' 3708 if plural is None: 3709 plural = 'memory_pools' 3710 writer.write_start(plural) 3711 if isinstance(objs, List): 3712 href = objs.href 3713 if href is not None: 3714 writer.write_attribute('href', href) 3715 for obj in objs: 3716 GlusterMemoryPoolWriter.write_one(obj, writer, singular) 3717 writer.write_end() 3718 3719 3720class GlusterServerHookWriter(Writer): 3721 3722 def __init__(self): 3723 super(GlusterServerHookWriter, self).__init__() 3724 3725 @staticmethod 3726 def write_one(obj, writer, singular=None): 3727 if singular is None: 3728 singular = 'server_hook' 3729 writer.write_start(singular) 3730 href = obj.href 3731 if href is not None: 3732 writer.write_attribute('href', href) 3733 if obj.id is not None: 3734 writer.write_attribute('id', obj.id) 3735 if obj.checksum is not None: 3736 Writer.write_string(writer, 'checksum', obj.checksum) 3737 if obj.comment is not None: 3738 Writer.write_string(writer, 'comment', obj.comment) 3739 if obj.content_type is not None: 3740 Writer.write_string(writer, 'content_type', obj.content_type.value) 3741 if obj.description is not None: 3742 Writer.write_string(writer, 'description', obj.description) 3743 if obj.name is not None: 3744 Writer.write_string(writer, 'name', obj.name) 3745 if obj.status is not None: 3746 Writer.write_string(writer, 'status', obj.status.value) 3747 if obj.host is not None: 3748 HostWriter.write_one(obj.host, writer, 'host') 3749 writer.write_end() 3750 3751 @staticmethod 3752 def write_many(objs, writer, singular=None, plural=None): 3753 if singular is None: 3754 singular = 'server_hook' 3755 if plural is None: 3756 plural = 'server_hooks' 3757 writer.write_start(plural) 3758 if isinstance(objs, List): 3759 href = objs.href 3760 if href is not None: 3761 writer.write_attribute('href', href) 3762 for obj in objs: 3763 GlusterServerHookWriter.write_one(obj, writer, singular) 3764 writer.write_end() 3765 3766 3767class GlusterVolumeWriter(Writer): 3768 3769 def __init__(self): 3770 super(GlusterVolumeWriter, self).__init__() 3771 3772 @staticmethod 3773 def write_one(obj, writer, singular=None): 3774 if singular is None: 3775 singular = 'gluster_volume' 3776 writer.write_start(singular) 3777 href = obj.href 3778 if href is not None: 3779 writer.write_attribute('href', href) 3780 if obj.id is not None: 3781 writer.write_attribute('id', obj.id) 3782 if obj.comment is not None: 3783 Writer.write_string(writer, 'comment', obj.comment) 3784 if obj.description is not None: 3785 Writer.write_string(writer, 'description', obj.description) 3786 if obj.disperse_count is not None: 3787 Writer.write_integer(writer, 'disperse_count', obj.disperse_count) 3788 if obj.name is not None: 3789 Writer.write_string(writer, 'name', obj.name) 3790 if obj.options is not None: 3791 OptionWriter.write_many(obj.options, writer, 'option', 'options') 3792 if obj.redundancy_count is not None: 3793 Writer.write_integer(writer, 'redundancy_count', obj.redundancy_count) 3794 if obj.replica_count is not None: 3795 Writer.write_integer(writer, 'replica_count', obj.replica_count) 3796 if obj.status is not None: 3797 Writer.write_string(writer, 'status', obj.status.value) 3798 if obj.stripe_count is not None: 3799 Writer.write_integer(writer, 'stripe_count', obj.stripe_count) 3800 if obj.transport_types is not None: 3801 writer.write_start('transport_types') 3802 for item in obj.transport_types: 3803 if item is not None: 3804 Writer.write_string(writer, 'transport_type', item.value) 3805 writer.write_end() 3806 if obj.volume_type is not None: 3807 Writer.write_string(writer, 'volume_type', obj.volume_type.value) 3808 if obj.bricks is not None: 3809 GlusterBrickWriter.write_many(obj.bricks, writer, 'brick', 'bricks') 3810 if obj.cluster is not None: 3811 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3812 if obj.statistics is not None: 3813 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3814 writer.write_end() 3815 3816 @staticmethod 3817 def write_many(objs, writer, singular=None, plural=None): 3818 if singular is None: 3819 singular = 'gluster_volume' 3820 if plural is None: 3821 plural = 'gluster_volumes' 3822 writer.write_start(plural) 3823 if isinstance(objs, List): 3824 href = objs.href 3825 if href is not None: 3826 writer.write_attribute('href', href) 3827 for obj in objs: 3828 GlusterVolumeWriter.write_one(obj, writer, singular) 3829 writer.write_end() 3830 3831 3832class GlusterVolumeProfileDetailsWriter(Writer): 3833 3834 def __init__(self): 3835 super(GlusterVolumeProfileDetailsWriter, self).__init__() 3836 3837 @staticmethod 3838 def write_one(obj, writer, singular=None): 3839 if singular is None: 3840 singular = 'gluster_volume_profile_details' 3841 writer.write_start(singular) 3842 href = obj.href 3843 if href is not None: 3844 writer.write_attribute('href', href) 3845 if obj.id is not None: 3846 writer.write_attribute('id', obj.id) 3847 if obj.brick_profile_details is not None: 3848 BrickProfileDetailWriter.write_many(obj.brick_profile_details, writer, 'brick_profile_detail', 'brick_profile_details') 3849 if obj.comment is not None: 3850 Writer.write_string(writer, 'comment', obj.comment) 3851 if obj.description is not None: 3852 Writer.write_string(writer, 'description', obj.description) 3853 if obj.name is not None: 3854 Writer.write_string(writer, 'name', obj.name) 3855 if obj.nfs_profile_details is not None: 3856 NfsProfileDetailWriter.write_many(obj.nfs_profile_details, writer, 'nfs_profile_detail', 'nfs_profile_details') 3857 writer.write_end() 3858 3859 @staticmethod 3860 def write_many(objs, writer, singular=None, plural=None): 3861 if singular is None: 3862 singular = 'gluster_volume_profile_details' 3863 if plural is None: 3864 plural = 'gluster_volume_profile_detailss' 3865 writer.write_start(plural) 3866 if isinstance(objs, List): 3867 href = objs.href 3868 if href is not None: 3869 writer.write_attribute('href', href) 3870 for obj in objs: 3871 GlusterVolumeProfileDetailsWriter.write_one(obj, writer, singular) 3872 writer.write_end() 3873 3874 3875class GracePeriodWriter(Writer): 3876 3877 def __init__(self): 3878 super(GracePeriodWriter, self).__init__() 3879 3880 @staticmethod 3881 def write_one(obj, writer, singular=None): 3882 if singular is None: 3883 singular = 'grace_period' 3884 writer.write_start(singular) 3885 href = obj.href 3886 if href is not None: 3887 writer.write_attribute('href', href) 3888 if obj.expiry is not None: 3889 Writer.write_integer(writer, 'expiry', obj.expiry) 3890 writer.write_end() 3891 3892 @staticmethod 3893 def write_many(objs, writer, singular=None, plural=None): 3894 if singular is None: 3895 singular = 'grace_period' 3896 if plural is None: 3897 plural = 'grace_periods' 3898 writer.write_start(plural) 3899 if isinstance(objs, List): 3900 href = objs.href 3901 if href is not None: 3902 writer.write_attribute('href', href) 3903 for obj in objs: 3904 GracePeriodWriter.write_one(obj, writer, singular) 3905 writer.write_end() 3906 3907 3908class GraphicsConsoleWriter(Writer): 3909 3910 def __init__(self): 3911 super(GraphicsConsoleWriter, self).__init__() 3912 3913 @staticmethod 3914 def write_one(obj, writer, singular=None): 3915 if singular is None: 3916 singular = 'graphics_console' 3917 writer.write_start(singular) 3918 href = obj.href 3919 if href is not None: 3920 writer.write_attribute('href', href) 3921 if obj.id is not None: 3922 writer.write_attribute('id', obj.id) 3923 if obj.address is not None: 3924 Writer.write_string(writer, 'address', obj.address) 3925 if obj.comment is not None: 3926 Writer.write_string(writer, 'comment', obj.comment) 3927 if obj.description is not None: 3928 Writer.write_string(writer, 'description', obj.description) 3929 if obj.name is not None: 3930 Writer.write_string(writer, 'name', obj.name) 3931 if obj.port is not None: 3932 Writer.write_integer(writer, 'port', obj.port) 3933 if obj.protocol is not None: 3934 Writer.write_string(writer, 'protocol', obj.protocol.value) 3935 if obj.tls_port is not None: 3936 Writer.write_integer(writer, 'tls_port', obj.tls_port) 3937 if obj.instance_type is not None: 3938 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3939 if obj.template is not None: 3940 TemplateWriter.write_one(obj.template, writer, 'template') 3941 if obj.vm is not None: 3942 VmWriter.write_one(obj.vm, writer, 'vm') 3943 writer.write_end() 3944 3945 @staticmethod 3946 def write_many(objs, writer, singular=None, plural=None): 3947 if singular is None: 3948 singular = 'graphics_console' 3949 if plural is None: 3950 plural = 'graphics_consoles' 3951 writer.write_start(plural) 3952 if isinstance(objs, List): 3953 href = objs.href 3954 if href is not None: 3955 writer.write_attribute('href', href) 3956 for obj in objs: 3957 GraphicsConsoleWriter.write_one(obj, writer, singular) 3958 writer.write_end() 3959 3960 3961class GroupWriter(Writer): 3962 3963 def __init__(self): 3964 super(GroupWriter, self).__init__() 3965 3966 @staticmethod 3967 def write_one(obj, writer, singular=None): 3968 if singular is None: 3969 singular = 'group' 3970 writer.write_start(singular) 3971 href = obj.href 3972 if href is not None: 3973 writer.write_attribute('href', href) 3974 if obj.id is not None: 3975 writer.write_attribute('id', obj.id) 3976 if obj.comment is not None: 3977 Writer.write_string(writer, 'comment', obj.comment) 3978 if obj.description is not None: 3979 Writer.write_string(writer, 'description', obj.description) 3980 if obj.domain_entry_id is not None: 3981 Writer.write_string(writer, 'domain_entry_id', obj.domain_entry_id) 3982 if obj.name is not None: 3983 Writer.write_string(writer, 'name', obj.name) 3984 if obj.namespace is not None: 3985 Writer.write_string(writer, 'namespace', obj.namespace) 3986 if obj.domain is not None: 3987 DomainWriter.write_one(obj.domain, writer, 'domain') 3988 if obj.permissions is not None: 3989 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 3990 if obj.roles is not None: 3991 RoleWriter.write_many(obj.roles, writer, 'role', 'roles') 3992 if obj.tags is not None: 3993 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 3994 writer.write_end() 3995 3996 @staticmethod 3997 def write_many(objs, writer, singular=None, plural=None): 3998 if singular is None: 3999 singular = 'group' 4000 if plural is None: 4001 plural = 'groups' 4002 writer.write_start(plural) 4003 if isinstance(objs, List): 4004 href = objs.href 4005 if href is not None: 4006 writer.write_attribute('href', href) 4007 for obj in objs: 4008 GroupWriter.write_one(obj, writer, singular) 4009 writer.write_end() 4010 4011 4012class GuestOperatingSystemWriter(Writer): 4013 4014 def __init__(self): 4015 super(GuestOperatingSystemWriter, self).__init__() 4016 4017 @staticmethod 4018 def write_one(obj, writer, singular=None): 4019 if singular is None: 4020 singular = 'guest_operating_system' 4021 writer.write_start(singular) 4022 href = obj.href 4023 if href is not None: 4024 writer.write_attribute('href', href) 4025 if obj.architecture is not None: 4026 Writer.write_string(writer, 'architecture', obj.architecture) 4027 if obj.codename is not None: 4028 Writer.write_string(writer, 'codename', obj.codename) 4029 if obj.distribution is not None: 4030 Writer.write_string(writer, 'distribution', obj.distribution) 4031 if obj.family is not None: 4032 Writer.write_string(writer, 'family', obj.family) 4033 if obj.kernel is not None: 4034 KernelWriter.write_one(obj.kernel, writer, 'kernel') 4035 if obj.version is not None: 4036 VersionWriter.write_one(obj.version, writer, 'version') 4037 writer.write_end() 4038 4039 @staticmethod 4040 def write_many(objs, writer, singular=None, plural=None): 4041 if singular is None: 4042 singular = 'guest_operating_system' 4043 if plural is None: 4044 plural = 'guest_operating_systems' 4045 writer.write_start(plural) 4046 if isinstance(objs, List): 4047 href = objs.href 4048 if href is not None: 4049 writer.write_attribute('href', href) 4050 for obj in objs: 4051 GuestOperatingSystemWriter.write_one(obj, writer, singular) 4052 writer.write_end() 4053 4054 4055class HardwareInformationWriter(Writer): 4056 4057 def __init__(self): 4058 super(HardwareInformationWriter, self).__init__() 4059 4060 @staticmethod 4061 def write_one(obj, writer, singular=None): 4062 if singular is None: 4063 singular = 'hardware_information' 4064 writer.write_start(singular) 4065 href = obj.href 4066 if href is not None: 4067 writer.write_attribute('href', href) 4068 if obj.family is not None: 4069 Writer.write_string(writer, 'family', obj.family) 4070 if obj.manufacturer is not None: 4071 Writer.write_string(writer, 'manufacturer', obj.manufacturer) 4072 if obj.product_name is not None: 4073 Writer.write_string(writer, 'product_name', obj.product_name) 4074 if obj.serial_number is not None: 4075 Writer.write_string(writer, 'serial_number', obj.serial_number) 4076 if obj.supported_rng_sources is not None: 4077 writer.write_start('supported_rng_sources') 4078 for item in obj.supported_rng_sources: 4079 if item is not None: 4080 Writer.write_string(writer, 'supported_rng_source', item.value) 4081 writer.write_end() 4082 if obj.uuid is not None: 4083 Writer.write_string(writer, 'uuid', obj.uuid) 4084 if obj.version is not None: 4085 Writer.write_string(writer, 'version', obj.version) 4086 writer.write_end() 4087 4088 @staticmethod 4089 def write_many(objs, writer, singular=None, plural=None): 4090 if singular is None: 4091 singular = 'hardware_information' 4092 if plural is None: 4093 plural = 'hardware_informations' 4094 writer.write_start(plural) 4095 if isinstance(objs, List): 4096 href = objs.href 4097 if href is not None: 4098 writer.write_attribute('href', href) 4099 for obj in objs: 4100 HardwareInformationWriter.write_one(obj, writer, singular) 4101 writer.write_end() 4102 4103 4104class HighAvailabilityWriter(Writer): 4105 4106 def __init__(self): 4107 super(HighAvailabilityWriter, self).__init__() 4108 4109 @staticmethod 4110 def write_one(obj, writer, singular=None): 4111 if singular is None: 4112 singular = 'high_availability' 4113 writer.write_start(singular) 4114 href = obj.href 4115 if href is not None: 4116 writer.write_attribute('href', href) 4117 if obj.enabled is not None: 4118 Writer.write_boolean(writer, 'enabled', obj.enabled) 4119 if obj.priority is not None: 4120 Writer.write_integer(writer, 'priority', obj.priority) 4121 writer.write_end() 4122 4123 @staticmethod 4124 def write_many(objs, writer, singular=None, plural=None): 4125 if singular is None: 4126 singular = 'high_availability' 4127 if plural is None: 4128 plural = 'high_availabilities' 4129 writer.write_start(plural) 4130 if isinstance(objs, List): 4131 href = objs.href 4132 if href is not None: 4133 writer.write_attribute('href', href) 4134 for obj in objs: 4135 HighAvailabilityWriter.write_one(obj, writer, singular) 4136 writer.write_end() 4137 4138 4139class HookWriter(Writer): 4140 4141 def __init__(self): 4142 super(HookWriter, self).__init__() 4143 4144 @staticmethod 4145 def write_one(obj, writer, singular=None): 4146 if singular is None: 4147 singular = 'hook' 4148 writer.write_start(singular) 4149 href = obj.href 4150 if href is not None: 4151 writer.write_attribute('href', href) 4152 if obj.id is not None: 4153 writer.write_attribute('id', obj.id) 4154 if obj.comment is not None: 4155 Writer.write_string(writer, 'comment', obj.comment) 4156 if obj.description is not None: 4157 Writer.write_string(writer, 'description', obj.description) 4158 if obj.event_name is not None: 4159 Writer.write_string(writer, 'event_name', obj.event_name) 4160 if obj.md5 is not None: 4161 Writer.write_string(writer, 'md5', obj.md5) 4162 if obj.name is not None: 4163 Writer.write_string(writer, 'name', obj.name) 4164 if obj.host is not None: 4165 HostWriter.write_one(obj.host, writer, 'host') 4166 writer.write_end() 4167 4168 @staticmethod 4169 def write_many(objs, writer, singular=None, plural=None): 4170 if singular is None: 4171 singular = 'hook' 4172 if plural is None: 4173 plural = 'hooks' 4174 writer.write_start(plural) 4175 if isinstance(objs, List): 4176 href = objs.href 4177 if href is not None: 4178 writer.write_attribute('href', href) 4179 for obj in objs: 4180 HookWriter.write_one(obj, writer, singular) 4181 writer.write_end() 4182 4183 4184class HostWriter(Writer): 4185 4186 def __init__(self): 4187 super(HostWriter, self).__init__() 4188 4189 @staticmethod 4190 def write_one(obj, writer, singular=None): 4191 if singular is None: 4192 singular = 'host' 4193 writer.write_start(singular) 4194 href = obj.href 4195 if href is not None: 4196 writer.write_attribute('href', href) 4197 if obj.id is not None: 4198 writer.write_attribute('id', obj.id) 4199 if obj.address is not None: 4200 Writer.write_string(writer, 'address', obj.address) 4201 if obj.auto_numa_status is not None: 4202 Writer.write_string(writer, 'auto_numa_status', obj.auto_numa_status.value) 4203 if obj.certificate is not None: 4204 CertificateWriter.write_one(obj.certificate, writer, 'certificate') 4205 if obj.comment is not None: 4206 Writer.write_string(writer, 'comment', obj.comment) 4207 if obj.cpu is not None: 4208 CpuWriter.write_one(obj.cpu, writer, 'cpu') 4209 if obj.description is not None: 4210 Writer.write_string(writer, 'description', obj.description) 4211 if obj.device_passthrough is not None: 4212 HostDevicePassthroughWriter.write_one(obj.device_passthrough, writer, 'device_passthrough') 4213 if obj.display is not None: 4214 DisplayWriter.write_one(obj.display, writer, 'display') 4215 if obj.external_status is not None: 4216 Writer.write_string(writer, 'external_status', obj.external_status.value) 4217 if obj.hardware_information is not None: 4218 HardwareInformationWriter.write_one(obj.hardware_information, writer, 'hardware_information') 4219 if obj.hosted_engine is not None: 4220 HostedEngineWriter.write_one(obj.hosted_engine, writer, 'hosted_engine') 4221 if obj.iscsi is not None: 4222 IscsiDetailsWriter.write_one(obj.iscsi, writer, 'iscsi') 4223 if obj.kdump_status is not None: 4224 Writer.write_string(writer, 'kdump_status', obj.kdump_status.value) 4225 if obj.ksm is not None: 4226 KsmWriter.write_one(obj.ksm, writer, 'ksm') 4227 if obj.libvirt_version is not None: 4228 VersionWriter.write_one(obj.libvirt_version, writer, 'libvirt_version') 4229 if obj.max_scheduling_memory is not None: 4230 Writer.write_integer(writer, 'max_scheduling_memory', obj.max_scheduling_memory) 4231 if obj.memory is not None: 4232 Writer.write_integer(writer, 'memory', obj.memory) 4233 if obj.name is not None: 4234 Writer.write_string(writer, 'name', obj.name) 4235 if obj.network_operation_in_progress is not None: 4236 Writer.write_boolean(writer, 'network_operation_in_progress', obj.network_operation_in_progress) 4237 if obj.numa_supported is not None: 4238 Writer.write_boolean(writer, 'numa_supported', obj.numa_supported) 4239 if obj.os is not None: 4240 OperatingSystemWriter.write_one(obj.os, writer, 'os') 4241 if obj.override_iptables is not None: 4242 Writer.write_boolean(writer, 'override_iptables', obj.override_iptables) 4243 if obj.ovn_configured is not None: 4244 Writer.write_boolean(writer, 'ovn_configured', obj.ovn_configured) 4245 if obj.port is not None: 4246 Writer.write_integer(writer, 'port', obj.port) 4247 if obj.power_management is not None: 4248 PowerManagementWriter.write_one(obj.power_management, writer, 'power_management') 4249 if obj.protocol is not None: 4250 Writer.write_string(writer, 'protocol', obj.protocol.value) 4251 if obj.reinstallation_required is not None: 4252 Writer.write_boolean(writer, 'reinstallation_required', obj.reinstallation_required) 4253 if obj.root_password is not None: 4254 Writer.write_string(writer, 'root_password', obj.root_password) 4255 if obj.se_linux is not None: 4256 SeLinuxWriter.write_one(obj.se_linux, writer, 'se_linux') 4257 if obj.spm is not None: 4258 SpmWriter.write_one(obj.spm, writer, 'spm') 4259 if obj.ssh is not None: 4260 SshWriter.write_one(obj.ssh, writer, 'ssh') 4261 if obj.status is not None: 4262 Writer.write_string(writer, 'status', obj.status.value) 4263 if obj.status_detail is not None: 4264 Writer.write_string(writer, 'status_detail', obj.status_detail) 4265 if obj.summary is not None: 4266 VmSummaryWriter.write_one(obj.summary, writer, 'summary') 4267 if obj.transparent_huge_pages is not None: 4268 TransparentHugePagesWriter.write_one(obj.transparent_huge_pages, writer, 'transparent_hugepages') 4269 if obj.type is not None: 4270 Writer.write_string(writer, 'type', obj.type.value) 4271 if obj.update_available is not None: 4272 Writer.write_boolean(writer, 'update_available', obj.update_available) 4273 if obj.version is not None: 4274 VersionWriter.write_one(obj.version, writer, 'version') 4275 if obj.vgpu_placement is not None: 4276 Writer.write_string(writer, 'vgpu_placement', obj.vgpu_placement.value) 4277 if obj.affinity_labels is not None: 4278 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 4279 if obj.agents is not None: 4280 AgentWriter.write_many(obj.agents, writer, 'agent', 'agents') 4281 if obj.cluster is not None: 4282 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 4283 if obj.cpu_units is not None: 4284 HostCpuUnitWriter.write_many(obj.cpu_units, writer, 'host_cpu_unit', 'cpu_units') 4285 if obj.devices is not None: 4286 HostDeviceWriter.write_many(obj.devices, writer, 'host_device', 'devices') 4287 if obj.external_host_provider is not None: 4288 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 4289 if obj.external_network_provider_configurations is not None: 4290 ExternalNetworkProviderConfigurationWriter.write_many(obj.external_network_provider_configurations, writer, 'external_network_provider_configuration', 'external_network_provider_configurations') 4291 if obj.hooks is not None: 4292 HookWriter.write_many(obj.hooks, writer, 'hook', 'hooks') 4293 if obj.katello_errata is not None: 4294 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 4295 if obj.network_attachments is not None: 4296 NetworkAttachmentWriter.write_many(obj.network_attachments, writer, 'network_attachment', 'network_attachments') 4297 if obj.nics is not None: 4298 HostNicWriter.write_many(obj.nics, writer, 'host_nic', 'nics') 4299 if obj.numa_nodes is not None: 4300 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 4301 if obj.permissions is not None: 4302 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 4303 if obj.statistics is not None: 4304 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 4305 if obj.storage_connection_extensions is not None: 4306 StorageConnectionExtensionWriter.write_many(obj.storage_connection_extensions, writer, 'storage_connection_extension', 'storage_connection_extensions') 4307 if obj.storages is not None: 4308 HostStorageWriter.write_many(obj.storages, writer, 'host_storage', 'storages') 4309 if obj.tags is not None: 4310 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 4311 if obj.unmanaged_networks is not None: 4312 UnmanagedNetworkWriter.write_many(obj.unmanaged_networks, writer, 'unmanaged_network', 'unmanaged_networks') 4313 writer.write_end() 4314 4315 @staticmethod 4316 def write_many(objs, writer, singular=None, plural=None): 4317 if singular is None: 4318 singular = 'host' 4319 if plural is None: 4320 plural = 'hosts' 4321 writer.write_start(plural) 4322 if isinstance(objs, List): 4323 href = objs.href 4324 if href is not None: 4325 writer.write_attribute('href', href) 4326 for obj in objs: 4327 HostWriter.write_one(obj, writer, singular) 4328 writer.write_end() 4329 4330 4331class HostCpuUnitWriter(Writer): 4332 4333 def __init__(self): 4334 super(HostCpuUnitWriter, self).__init__() 4335 4336 @staticmethod 4337 def write_one(obj, writer, singular=None): 4338 if singular is None: 4339 singular = 'host_cpu_unit' 4340 writer.write_start(singular) 4341 href = obj.href 4342 if href is not None: 4343 writer.write_attribute('href', href) 4344 if obj.id is not None: 4345 writer.write_attribute('id', obj.id) 4346 if obj.comment is not None: 4347 Writer.write_string(writer, 'comment', obj.comment) 4348 if obj.core_id is not None: 4349 Writer.write_integer(writer, 'core_id', obj.core_id) 4350 if obj.cpu_id is not None: 4351 Writer.write_integer(writer, 'cpu_id', obj.cpu_id) 4352 if obj.description is not None: 4353 Writer.write_string(writer, 'description', obj.description) 4354 if obj.name is not None: 4355 Writer.write_string(writer, 'name', obj.name) 4356 if obj.runs_vdsm is not None: 4357 Writer.write_boolean(writer, 'runs_vdsm', obj.runs_vdsm) 4358 if obj.socket_id is not None: 4359 Writer.write_integer(writer, 'socket_id', obj.socket_id) 4360 if obj.vms is not None: 4361 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 4362 writer.write_end() 4363 4364 @staticmethod 4365 def write_many(objs, writer, singular=None, plural=None): 4366 if singular is None: 4367 singular = 'host_cpu_unit' 4368 if plural is None: 4369 plural = 'host_cpu_units' 4370 writer.write_start(plural) 4371 if isinstance(objs, List): 4372 href = objs.href 4373 if href is not None: 4374 writer.write_attribute('href', href) 4375 for obj in objs: 4376 HostCpuUnitWriter.write_one(obj, writer, singular) 4377 writer.write_end() 4378 4379 4380class HostDeviceWriter(Writer): 4381 4382 def __init__(self): 4383 super(HostDeviceWriter, self).__init__() 4384 4385 @staticmethod 4386 def write_one(obj, writer, singular=None): 4387 if singular is None: 4388 singular = 'host_device' 4389 writer.write_start(singular) 4390 href = obj.href 4391 if href is not None: 4392 writer.write_attribute('href', href) 4393 if obj.id is not None: 4394 writer.write_attribute('id', obj.id) 4395 if obj.capability is not None: 4396 Writer.write_string(writer, 'capability', obj.capability) 4397 if obj.comment is not None: 4398 Writer.write_string(writer, 'comment', obj.comment) 4399 if obj.description is not None: 4400 Writer.write_string(writer, 'description', obj.description) 4401 if obj.driver is not None: 4402 Writer.write_string(writer, 'driver', obj.driver) 4403 if obj.iommu_group is not None: 4404 Writer.write_integer(writer, 'iommu_group', obj.iommu_group) 4405 if obj.m_dev_types is not None: 4406 MDevTypeWriter.write_many(obj.m_dev_types, writer, 'm_dev_type', 'm_dev_types') 4407 if obj.name is not None: 4408 Writer.write_string(writer, 'name', obj.name) 4409 if obj.physical_function is not None: 4410 HostDeviceWriter.write_one(obj.physical_function, writer, 'physical_function') 4411 if obj.placeholder is not None: 4412 Writer.write_boolean(writer, 'placeholder', obj.placeholder) 4413 if obj.product is not None: 4414 ProductWriter.write_one(obj.product, writer, 'product') 4415 if obj.vendor is not None: 4416 VendorWriter.write_one(obj.vendor, writer, 'vendor') 4417 if obj.virtual_functions is not None: 4418 Writer.write_integer(writer, 'virtual_functions', obj.virtual_functions) 4419 if obj.host is not None: 4420 HostWriter.write_one(obj.host, writer, 'host') 4421 if obj.parent_device is not None: 4422 HostDeviceWriter.write_one(obj.parent_device, writer, 'parent_device') 4423 if obj.vm is not None: 4424 VmWriter.write_one(obj.vm, writer, 'vm') 4425 writer.write_end() 4426 4427 @staticmethod 4428 def write_many(objs, writer, singular=None, plural=None): 4429 if singular is None: 4430 singular = 'host_device' 4431 if plural is None: 4432 plural = 'host_devices' 4433 writer.write_start(plural) 4434 if isinstance(objs, List): 4435 href = objs.href 4436 if href is not None: 4437 writer.write_attribute('href', href) 4438 for obj in objs: 4439 HostDeviceWriter.write_one(obj, writer, singular) 4440 writer.write_end() 4441 4442 4443class HostDevicePassthroughWriter(Writer): 4444 4445 def __init__(self): 4446 super(HostDevicePassthroughWriter, self).__init__() 4447 4448 @staticmethod 4449 def write_one(obj, writer, singular=None): 4450 if singular is None: 4451 singular = 'host_device_passthrough' 4452 writer.write_start(singular) 4453 href = obj.href 4454 if href is not None: 4455 writer.write_attribute('href', href) 4456 if obj.enabled is not None: 4457 Writer.write_boolean(writer, 'enabled', obj.enabled) 4458 writer.write_end() 4459 4460 @staticmethod 4461 def write_many(objs, writer, singular=None, plural=None): 4462 if singular is None: 4463 singular = 'host_device_passthrough' 4464 if plural is None: 4465 plural = 'host_device_passthroughs' 4466 writer.write_start(plural) 4467 if isinstance(objs, List): 4468 href = objs.href 4469 if href is not None: 4470 writer.write_attribute('href', href) 4471 for obj in objs: 4472 HostDevicePassthroughWriter.write_one(obj, writer, singular) 4473 writer.write_end() 4474 4475 4476class HostNicWriter(Writer): 4477 4478 def __init__(self): 4479 super(HostNicWriter, self).__init__() 4480 4481 @staticmethod 4482 def write_one(obj, writer, singular=None): 4483 if singular is None: 4484 singular = 'host_nic' 4485 writer.write_start(singular) 4486 href = obj.href 4487 if href is not None: 4488 writer.write_attribute('href', href) 4489 if obj.id is not None: 4490 writer.write_attribute('id', obj.id) 4491 if obj.ad_aggregator_id is not None: 4492 Writer.write_integer(writer, 'ad_aggregator_id', obj.ad_aggregator_id) 4493 if obj.base_interface is not None: 4494 Writer.write_string(writer, 'base_interface', obj.base_interface) 4495 if obj.bonding is not None: 4496 BondingWriter.write_one(obj.bonding, writer, 'bonding') 4497 if obj.boot_protocol is not None: 4498 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 4499 if obj.bridged is not None: 4500 Writer.write_boolean(writer, 'bridged', obj.bridged) 4501 if obj.check_connectivity is not None: 4502 Writer.write_boolean(writer, 'check_connectivity', obj.check_connectivity) 4503 if obj.comment is not None: 4504 Writer.write_string(writer, 'comment', obj.comment) 4505 if obj.custom_configuration is not None: 4506 Writer.write_boolean(writer, 'custom_configuration', obj.custom_configuration) 4507 if obj.description is not None: 4508 Writer.write_string(writer, 'description', obj.description) 4509 if obj.ip is not None: 4510 IpWriter.write_one(obj.ip, writer, 'ip') 4511 if obj.ipv6 is not None: 4512 IpWriter.write_one(obj.ipv6, writer, 'ipv6') 4513 if obj.ipv6_boot_protocol is not None: 4514 Writer.write_string(writer, 'ipv6_boot_protocol', obj.ipv6_boot_protocol.value) 4515 if obj.mac is not None: 4516 MacWriter.write_one(obj.mac, writer, 'mac') 4517 if obj.mtu is not None: 4518 Writer.write_integer(writer, 'mtu', obj.mtu) 4519 if obj.name is not None: 4520 Writer.write_string(writer, 'name', obj.name) 4521 if obj.override_configuration is not None: 4522 Writer.write_boolean(writer, 'override_configuration', obj.override_configuration) 4523 if obj.properties is not None: 4524 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 4525 if obj.speed is not None: 4526 Writer.write_integer(writer, 'speed', obj.speed) 4527 if obj.status is not None: 4528 Writer.write_string(writer, 'status', obj.status.value) 4529 if obj.virtual_functions_configuration is not None: 4530 HostNicVirtualFunctionsConfigurationWriter.write_one(obj.virtual_functions_configuration, writer, 'virtual_functions_configuration') 4531 if obj.vlan is not None: 4532 VlanWriter.write_one(obj.vlan, writer, 'vlan') 4533 if obj.host is not None: 4534 HostWriter.write_one(obj.host, writer, 'host') 4535 if obj.network is not None: 4536 NetworkWriter.write_one(obj.network, writer, 'network') 4537 if obj.network_labels is not None: 4538 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 4539 if obj.physical_function is not None: 4540 HostNicWriter.write_one(obj.physical_function, writer, 'physical_function') 4541 if obj.qos is not None: 4542 QosWriter.write_one(obj.qos, writer, 'qos') 4543 if obj.statistics is not None: 4544 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 4545 writer.write_end() 4546 4547 @staticmethod 4548 def write_many(objs, writer, singular=None, plural=None): 4549 if singular is None: 4550 singular = 'host_nic' 4551 if plural is None: 4552 plural = 'host_nics' 4553 writer.write_start(plural) 4554 if isinstance(objs, List): 4555 href = objs.href 4556 if href is not None: 4557 writer.write_attribute('href', href) 4558 for obj in objs: 4559 HostNicWriter.write_one(obj, writer, singular) 4560 writer.write_end() 4561 4562 4563class HostNicVirtualFunctionsConfigurationWriter(Writer): 4564 4565 def __init__(self): 4566 super(HostNicVirtualFunctionsConfigurationWriter, self).__init__() 4567 4568 @staticmethod 4569 def write_one(obj, writer, singular=None): 4570 if singular is None: 4571 singular = 'host_nic_virtual_functions_configuration' 4572 writer.write_start(singular) 4573 href = obj.href 4574 if href is not None: 4575 writer.write_attribute('href', href) 4576 if obj.all_networks_allowed is not None: 4577 Writer.write_boolean(writer, 'all_networks_allowed', obj.all_networks_allowed) 4578 if obj.max_number_of_virtual_functions is not None: 4579 Writer.write_integer(writer, 'max_number_of_virtual_functions', obj.max_number_of_virtual_functions) 4580 if obj.number_of_virtual_functions is not None: 4581 Writer.write_integer(writer, 'number_of_virtual_functions', obj.number_of_virtual_functions) 4582 writer.write_end() 4583 4584 @staticmethod 4585 def write_many(objs, writer, singular=None, plural=None): 4586 if singular is None: 4587 singular = 'host_nic_virtual_functions_configuration' 4588 if plural is None: 4589 plural = 'host_nic_virtual_functions_configurations' 4590 writer.write_start(plural) 4591 if isinstance(objs, List): 4592 href = objs.href 4593 if href is not None: 4594 writer.write_attribute('href', href) 4595 for obj in objs: 4596 HostNicVirtualFunctionsConfigurationWriter.write_one(obj, writer, singular) 4597 writer.write_end() 4598 4599 4600class HostStorageWriter(Writer): 4601 4602 def __init__(self): 4603 super(HostStorageWriter, self).__init__() 4604 4605 @staticmethod 4606 def write_one(obj, writer, singular=None): 4607 if singular is None: 4608 singular = 'host_storage' 4609 writer.write_start(singular) 4610 href = obj.href 4611 if href is not None: 4612 writer.write_attribute('href', href) 4613 if obj.id is not None: 4614 writer.write_attribute('id', obj.id) 4615 if obj.address is not None: 4616 Writer.write_string(writer, 'address', obj.address) 4617 if obj.comment is not None: 4618 Writer.write_string(writer, 'comment', obj.comment) 4619 if obj.description is not None: 4620 Writer.write_string(writer, 'description', obj.description) 4621 if obj.driver_options is not None: 4622 PropertyWriter.write_many(obj.driver_options, writer, 'property', 'driver_options') 4623 if obj.driver_sensitive_options is not None: 4624 PropertyWriter.write_many(obj.driver_sensitive_options, writer, 'property', 'driver_sensitive_options') 4625 if obj.logical_units is not None: 4626 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 4627 if obj.mount_options is not None: 4628 Writer.write_string(writer, 'mount_options', obj.mount_options) 4629 if obj.name is not None: 4630 Writer.write_string(writer, 'name', obj.name) 4631 if obj.nfs_retrans is not None: 4632 Writer.write_integer(writer, 'nfs_retrans', obj.nfs_retrans) 4633 if obj.nfs_timeo is not None: 4634 Writer.write_integer(writer, 'nfs_timeo', obj.nfs_timeo) 4635 if obj.nfs_version is not None: 4636 Writer.write_string(writer, 'nfs_version', obj.nfs_version.value) 4637 if obj.override_luns is not None: 4638 Writer.write_boolean(writer, 'override_luns', obj.override_luns) 4639 if obj.password is not None: 4640 Writer.write_string(writer, 'password', obj.password) 4641 if obj.path is not None: 4642 Writer.write_string(writer, 'path', obj.path) 4643 if obj.port is not None: 4644 Writer.write_integer(writer, 'port', obj.port) 4645 if obj.portal is not None: 4646 Writer.write_string(writer, 'portal', obj.portal) 4647 if obj.target is not None: 4648 Writer.write_string(writer, 'target', obj.target) 4649 if obj.type is not None: 4650 Writer.write_string(writer, 'type', obj.type.value) 4651 if obj.username is not None: 4652 Writer.write_string(writer, 'username', obj.username) 4653 if obj.vfs_type is not None: 4654 Writer.write_string(writer, 'vfs_type', obj.vfs_type) 4655 if obj.volume_group is not None: 4656 VolumeGroupWriter.write_one(obj.volume_group, writer, 'volume_group') 4657 if obj.host is not None: 4658 HostWriter.write_one(obj.host, writer, 'host') 4659 writer.write_end() 4660 4661 @staticmethod 4662 def write_many(objs, writer, singular=None, plural=None): 4663 if singular is None: 4664 singular = 'host_storage' 4665 if plural is None: 4666 plural = 'host_storages' 4667 writer.write_start(plural) 4668 if isinstance(objs, List): 4669 href = objs.href 4670 if href is not None: 4671 writer.write_attribute('href', href) 4672 for obj in objs: 4673 HostStorageWriter.write_one(obj, writer, singular) 4674 writer.write_end() 4675 4676 4677class HostedEngineWriter(Writer): 4678 4679 def __init__(self): 4680 super(HostedEngineWriter, self).__init__() 4681 4682 @staticmethod 4683 def write_one(obj, writer, singular=None): 4684 if singular is None: 4685 singular = 'hosted_engine' 4686 writer.write_start(singular) 4687 href = obj.href 4688 if href is not None: 4689 writer.write_attribute('href', href) 4690 if obj.active is not None: 4691 Writer.write_boolean(writer, 'active', obj.active) 4692 if obj.configured is not None: 4693 Writer.write_boolean(writer, 'configured', obj.configured) 4694 if obj.global_maintenance is not None: 4695 Writer.write_boolean(writer, 'global_maintenance', obj.global_maintenance) 4696 if obj.local_maintenance is not None: 4697 Writer.write_boolean(writer, 'local_maintenance', obj.local_maintenance) 4698 if obj.score is not None: 4699 Writer.write_integer(writer, 'score', obj.score) 4700 writer.write_end() 4701 4702 @staticmethod 4703 def write_many(objs, writer, singular=None, plural=None): 4704 if singular is None: 4705 singular = 'hosted_engine' 4706 if plural is None: 4707 plural = 'hosted_engines' 4708 writer.write_start(plural) 4709 if isinstance(objs, List): 4710 href = objs.href 4711 if href is not None: 4712 writer.write_attribute('href', href) 4713 for obj in objs: 4714 HostedEngineWriter.write_one(obj, writer, singular) 4715 writer.write_end() 4716 4717 4718class IconWriter(Writer): 4719 4720 def __init__(self): 4721 super(IconWriter, self).__init__() 4722 4723 @staticmethod 4724 def write_one(obj, writer, singular=None): 4725 if singular is None: 4726 singular = 'icon' 4727 writer.write_start(singular) 4728 href = obj.href 4729 if href is not None: 4730 writer.write_attribute('href', href) 4731 if obj.id is not None: 4732 writer.write_attribute('id', obj.id) 4733 if obj.comment is not None: 4734 Writer.write_string(writer, 'comment', obj.comment) 4735 if obj.data is not None: 4736 Writer.write_string(writer, 'data', obj.data) 4737 if obj.description is not None: 4738 Writer.write_string(writer, 'description', obj.description) 4739 if obj.media_type is not None: 4740 Writer.write_string(writer, 'media_type', obj.media_type) 4741 if obj.name is not None: 4742 Writer.write_string(writer, 'name', obj.name) 4743 writer.write_end() 4744 4745 @staticmethod 4746 def write_many(objs, writer, singular=None, plural=None): 4747 if singular is None: 4748 singular = 'icon' 4749 if plural is None: 4750 plural = 'icons' 4751 writer.write_start(plural) 4752 if isinstance(objs, List): 4753 href = objs.href 4754 if href is not None: 4755 writer.write_attribute('href', href) 4756 for obj in objs: 4757 IconWriter.write_one(obj, writer, singular) 4758 writer.write_end() 4759 4760 4761class IdentifiedWriter(Writer): 4762 4763 def __init__(self): 4764 super(IdentifiedWriter, self).__init__() 4765 4766 @staticmethod 4767 def write_one(obj, writer, singular=None): 4768 if singular is None: 4769 singular = 'identified' 4770 writer.write_start(singular) 4771 href = obj.href 4772 if href is not None: 4773 writer.write_attribute('href', href) 4774 if obj.id is not None: 4775 writer.write_attribute('id', obj.id) 4776 if obj.comment is not None: 4777 Writer.write_string(writer, 'comment', obj.comment) 4778 if obj.description is not None: 4779 Writer.write_string(writer, 'description', obj.description) 4780 if obj.name is not None: 4781 Writer.write_string(writer, 'name', obj.name) 4782 writer.write_end() 4783 4784 @staticmethod 4785 def write_many(objs, writer, singular=None, plural=None): 4786 if singular is None: 4787 singular = 'identified' 4788 if plural is None: 4789 plural = 'identifieds' 4790 writer.write_start(plural) 4791 if isinstance(objs, List): 4792 href = objs.href 4793 if href is not None: 4794 writer.write_attribute('href', href) 4795 for obj in objs: 4796 IdentifiedWriter.write_one(obj, writer, singular) 4797 writer.write_end() 4798 4799 4800class ImageWriter(Writer): 4801 4802 def __init__(self): 4803 super(ImageWriter, self).__init__() 4804 4805 @staticmethod 4806 def write_one(obj, writer, singular=None): 4807 if singular is None: 4808 singular = 'image' 4809 writer.write_start(singular) 4810 href = obj.href 4811 if href is not None: 4812 writer.write_attribute('href', href) 4813 if obj.id is not None: 4814 writer.write_attribute('id', obj.id) 4815 if obj.comment is not None: 4816 Writer.write_string(writer, 'comment', obj.comment) 4817 if obj.description is not None: 4818 Writer.write_string(writer, 'description', obj.description) 4819 if obj.name is not None: 4820 Writer.write_string(writer, 'name', obj.name) 4821 if obj.size is not None: 4822 Writer.write_integer(writer, 'size', obj.size) 4823 if obj.type is not None: 4824 Writer.write_string(writer, 'type', obj.type.value) 4825 if obj.storage_domain is not None: 4826 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 4827 writer.write_end() 4828 4829 @staticmethod 4830 def write_many(objs, writer, singular=None, plural=None): 4831 if singular is None: 4832 singular = 'image' 4833 if plural is None: 4834 plural = 'images' 4835 writer.write_start(plural) 4836 if isinstance(objs, List): 4837 href = objs.href 4838 if href is not None: 4839 writer.write_attribute('href', href) 4840 for obj in objs: 4841 ImageWriter.write_one(obj, writer, singular) 4842 writer.write_end() 4843 4844 4845class ImageTransferWriter(Writer): 4846 4847 def __init__(self): 4848 super(ImageTransferWriter, self).__init__() 4849 4850 @staticmethod 4851 def write_one(obj, writer, singular=None): 4852 if singular is None: 4853 singular = 'image_transfer' 4854 writer.write_start(singular) 4855 href = obj.href 4856 if href is not None: 4857 writer.write_attribute('href', href) 4858 if obj.id is not None: 4859 writer.write_attribute('id', obj.id) 4860 if obj.active is not None: 4861 Writer.write_boolean(writer, 'active', obj.active) 4862 if obj.comment is not None: 4863 Writer.write_string(writer, 'comment', obj.comment) 4864 if obj.description is not None: 4865 Writer.write_string(writer, 'description', obj.description) 4866 if obj.direction is not None: 4867 Writer.write_string(writer, 'direction', obj.direction.value) 4868 if obj.format is not None: 4869 Writer.write_string(writer, 'format', obj.format.value) 4870 if obj.inactivity_timeout is not None: 4871 Writer.write_integer(writer, 'inactivity_timeout', obj.inactivity_timeout) 4872 if obj.name is not None: 4873 Writer.write_string(writer, 'name', obj.name) 4874 if obj.phase is not None: 4875 Writer.write_string(writer, 'phase', obj.phase.value) 4876 if obj.proxy_url is not None: 4877 Writer.write_string(writer, 'proxy_url', obj.proxy_url) 4878 if obj.shallow is not None: 4879 Writer.write_boolean(writer, 'shallow', obj.shallow) 4880 if obj.timeout_policy is not None: 4881 Writer.write_string(writer, 'timeout_policy', obj.timeout_policy.value) 4882 if obj.transfer_url is not None: 4883 Writer.write_string(writer, 'transfer_url', obj.transfer_url) 4884 if obj.transferred is not None: 4885 Writer.write_integer(writer, 'transferred', obj.transferred) 4886 if obj.backup is not None: 4887 BackupWriter.write_one(obj.backup, writer, 'backup') 4888 if obj.disk is not None: 4889 DiskWriter.write_one(obj.disk, writer, 'disk') 4890 if obj.host is not None: 4891 HostWriter.write_one(obj.host, writer, 'host') 4892 if obj.image is not None: 4893 ImageWriter.write_one(obj.image, writer, 'image') 4894 if obj.snapshot is not None: 4895 DiskSnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 4896 writer.write_end() 4897 4898 @staticmethod 4899 def write_many(objs, writer, singular=None, plural=None): 4900 if singular is None: 4901 singular = 'image_transfer' 4902 if plural is None: 4903 plural = 'image_transfers' 4904 writer.write_start(plural) 4905 if isinstance(objs, List): 4906 href = objs.href 4907 if href is not None: 4908 writer.write_attribute('href', href) 4909 for obj in objs: 4910 ImageTransferWriter.write_one(obj, writer, singular) 4911 writer.write_end() 4912 4913 4914class InitializationWriter(Writer): 4915 4916 def __init__(self): 4917 super(InitializationWriter, self).__init__() 4918 4919 @staticmethod 4920 def write_one(obj, writer, singular=None): 4921 if singular is None: 4922 singular = 'initialization' 4923 writer.write_start(singular) 4924 href = obj.href 4925 if href is not None: 4926 writer.write_attribute('href', href) 4927 if obj.active_directory_ou is not None: 4928 Writer.write_string(writer, 'active_directory_ou', obj.active_directory_ou) 4929 if obj.authorized_ssh_keys is not None: 4930 Writer.write_string(writer, 'authorized_ssh_keys', obj.authorized_ssh_keys) 4931 if obj.cloud_init is not None: 4932 CloudInitWriter.write_one(obj.cloud_init, writer, 'cloud_init') 4933 if obj.cloud_init_network_protocol is not None: 4934 Writer.write_string(writer, 'cloud_init_network_protocol', obj.cloud_init_network_protocol.value) 4935 if obj.configuration is not None: 4936 ConfigurationWriter.write_one(obj.configuration, writer, 'configuration') 4937 if obj.custom_script is not None: 4938 Writer.write_string(writer, 'custom_script', obj.custom_script) 4939 if obj.dns_search is not None: 4940 Writer.write_string(writer, 'dns_search', obj.dns_search) 4941 if obj.dns_servers is not None: 4942 Writer.write_string(writer, 'dns_servers', obj.dns_servers) 4943 if obj.domain is not None: 4944 Writer.write_string(writer, 'domain', obj.domain) 4945 if obj.host_name is not None: 4946 Writer.write_string(writer, 'host_name', obj.host_name) 4947 if obj.input_locale is not None: 4948 Writer.write_string(writer, 'input_locale', obj.input_locale) 4949 if obj.nic_configurations is not None: 4950 NicConfigurationWriter.write_many(obj.nic_configurations, writer, 'nic_configuration', 'nic_configurations') 4951 if obj.org_name is not None: 4952 Writer.write_string(writer, 'org_name', obj.org_name) 4953 if obj.regenerate_ids is not None: 4954 Writer.write_boolean(writer, 'regenerate_ids', obj.regenerate_ids) 4955 if obj.regenerate_ssh_keys is not None: 4956 Writer.write_boolean(writer, 'regenerate_ssh_keys', obj.regenerate_ssh_keys) 4957 if obj.root_password is not None: 4958 Writer.write_string(writer, 'root_password', obj.root_password) 4959 if obj.system_locale is not None: 4960 Writer.write_string(writer, 'system_locale', obj.system_locale) 4961 if obj.timezone is not None: 4962 Writer.write_string(writer, 'timezone', obj.timezone) 4963 if obj.ui_language is not None: 4964 Writer.write_string(writer, 'ui_language', obj.ui_language) 4965 if obj.user_locale is not None: 4966 Writer.write_string(writer, 'user_locale', obj.user_locale) 4967 if obj.user_name is not None: 4968 Writer.write_string(writer, 'user_name', obj.user_name) 4969 if obj.windows_license_key is not None: 4970 Writer.write_string(writer, 'windows_license_key', obj.windows_license_key) 4971 writer.write_end() 4972 4973 @staticmethod 4974 def write_many(objs, writer, singular=None, plural=None): 4975 if singular is None: 4976 singular = 'initialization' 4977 if plural is None: 4978 plural = 'initializations' 4979 writer.write_start(plural) 4980 if isinstance(objs, List): 4981 href = objs.href 4982 if href is not None: 4983 writer.write_attribute('href', href) 4984 for obj in objs: 4985 InitializationWriter.write_one(obj, writer, singular) 4986 writer.write_end() 4987 4988 4989class InstanceTypeWriter(Writer): 4990 4991 def __init__(self): 4992 super(InstanceTypeWriter, self).__init__() 4993 4994 @staticmethod 4995 def write_one(obj, writer, singular=None): 4996 if singular is None: 4997 singular = 'instance_type' 4998 writer.write_start(singular) 4999 href = obj.href 5000 if href is not None: 5001 writer.write_attribute('href', href) 5002 if obj.id is not None: 5003 writer.write_attribute('id', obj.id) 5004 if obj.auto_pinning_policy is not None: 5005 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 5006 if obj.bios is not None: 5007 BiosWriter.write_one(obj.bios, writer, 'bios') 5008 if obj.comment is not None: 5009 Writer.write_string(writer, 'comment', obj.comment) 5010 if obj.console is not None: 5011 ConsoleWriter.write_one(obj.console, writer, 'console') 5012 if obj.cpu is not None: 5013 CpuWriter.write_one(obj.cpu, writer, 'cpu') 5014 if obj.cpu_pinning_policy is not None: 5015 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 5016 if obj.cpu_shares is not None: 5017 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 5018 if obj.creation_time is not None: 5019 Writer.write_date(writer, 'creation_time', obj.creation_time) 5020 if obj.custom_compatibility_version is not None: 5021 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 5022 if obj.custom_cpu_model is not None: 5023 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 5024 if obj.custom_emulated_machine is not None: 5025 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 5026 if obj.custom_properties is not None: 5027 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 5028 if obj.delete_protected is not None: 5029 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 5030 if obj.description is not None: 5031 Writer.write_string(writer, 'description', obj.description) 5032 if obj.display is not None: 5033 DisplayWriter.write_one(obj.display, writer, 'display') 5034 if obj.domain is not None: 5035 DomainWriter.write_one(obj.domain, writer, 'domain') 5036 if obj.high_availability is not None: 5037 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 5038 if obj.initialization is not None: 5039 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 5040 if obj.io is not None: 5041 IoWriter.write_one(obj.io, writer, 'io') 5042 if obj.large_icon is not None: 5043 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 5044 if obj.lease is not None: 5045 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 5046 if obj.memory is not None: 5047 Writer.write_integer(writer, 'memory', obj.memory) 5048 if obj.memory_policy is not None: 5049 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 5050 if obj.migration is not None: 5051 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 5052 if obj.migration_downtime is not None: 5053 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 5054 if obj.multi_queues_enabled is not None: 5055 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 5056 if obj.name is not None: 5057 Writer.write_string(writer, 'name', obj.name) 5058 if obj.origin is not None: 5059 Writer.write_string(writer, 'origin', obj.origin) 5060 if obj.os is not None: 5061 OperatingSystemWriter.write_one(obj.os, writer, 'os') 5062 if obj.placement_policy is not None: 5063 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 5064 if obj.rng_device is not None: 5065 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 5066 if obj.serial_number is not None: 5067 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 5068 if obj.small_icon is not None: 5069 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 5070 if obj.soundcard_enabled is not None: 5071 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 5072 if obj.sso is not None: 5073 SsoWriter.write_one(obj.sso, writer, 'sso') 5074 if obj.start_paused is not None: 5075 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 5076 if obj.stateless is not None: 5077 Writer.write_boolean(writer, 'stateless', obj.stateless) 5078 if obj.status is not None: 5079 Writer.write_string(writer, 'status', obj.status.value) 5080 if obj.storage_error_resume_behaviour is not None: 5081 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 5082 if obj.time_zone is not None: 5083 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 5084 if obj.tpm_enabled is not None: 5085 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 5086 if obj.tunnel_migration is not None: 5087 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 5088 if obj.type is not None: 5089 Writer.write_string(writer, 'type', obj.type.value) 5090 if obj.usb is not None: 5091 UsbWriter.write_one(obj.usb, writer, 'usb') 5092 if obj.version is not None: 5093 TemplateVersionWriter.write_one(obj.version, writer, 'version') 5094 if obj.virtio_scsi is not None: 5095 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 5096 if obj.virtio_scsi_multi_queues is not None: 5097 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 5098 if obj.virtio_scsi_multi_queues_enabled is not None: 5099 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 5100 if obj.vm is not None: 5101 VmWriter.write_one(obj.vm, writer, 'vm') 5102 if obj.cdroms is not None: 5103 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 5104 if obj.cluster is not None: 5105 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 5106 if obj.cpu_profile is not None: 5107 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 5108 if obj.disk_attachments is not None: 5109 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 5110 if obj.graphics_consoles is not None: 5111 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 5112 if obj.mediated_devices is not None: 5113 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 5114 if obj.nics is not None: 5115 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 5116 if obj.permissions is not None: 5117 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 5118 if obj.quota is not None: 5119 QuotaWriter.write_one(obj.quota, writer, 'quota') 5120 if obj.storage_domain is not None: 5121 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 5122 if obj.tags is not None: 5123 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 5124 if obj.watchdogs is not None: 5125 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 5126 writer.write_end() 5127 5128 @staticmethod 5129 def write_many(objs, writer, singular=None, plural=None): 5130 if singular is None: 5131 singular = 'instance_type' 5132 if plural is None: 5133 plural = 'instance_types' 5134 writer.write_start(plural) 5135 if isinstance(objs, List): 5136 href = objs.href 5137 if href is not None: 5138 writer.write_attribute('href', href) 5139 for obj in objs: 5140 InstanceTypeWriter.write_one(obj, writer, singular) 5141 writer.write_end() 5142 5143 5144class IoWriter(Writer): 5145 5146 def __init__(self): 5147 super(IoWriter, self).__init__() 5148 5149 @staticmethod 5150 def write_one(obj, writer, singular=None): 5151 if singular is None: 5152 singular = 'io' 5153 writer.write_start(singular) 5154 href = obj.href 5155 if href is not None: 5156 writer.write_attribute('href', href) 5157 if obj.threads is not None: 5158 Writer.write_integer(writer, 'threads', obj.threads) 5159 writer.write_end() 5160 5161 @staticmethod 5162 def write_many(objs, writer, singular=None, plural=None): 5163 if singular is None: 5164 singular = 'io' 5165 if plural is None: 5166 plural = 'ios' 5167 writer.write_start(plural) 5168 if isinstance(objs, List): 5169 href = objs.href 5170 if href is not None: 5171 writer.write_attribute('href', href) 5172 for obj in objs: 5173 IoWriter.write_one(obj, writer, singular) 5174 writer.write_end() 5175 5176 5177class IpWriter(Writer): 5178 5179 def __init__(self): 5180 super(IpWriter, self).__init__() 5181 5182 @staticmethod 5183 def write_one(obj, writer, singular=None): 5184 if singular is None: 5185 singular = 'ip' 5186 writer.write_start(singular) 5187 href = obj.href 5188 if href is not None: 5189 writer.write_attribute('href', href) 5190 if obj.address is not None: 5191 Writer.write_string(writer, 'address', obj.address) 5192 if obj.gateway is not None: 5193 Writer.write_string(writer, 'gateway', obj.gateway) 5194 if obj.netmask is not None: 5195 Writer.write_string(writer, 'netmask', obj.netmask) 5196 if obj.version is not None: 5197 Writer.write_string(writer, 'version', obj.version.value) 5198 writer.write_end() 5199 5200 @staticmethod 5201 def write_many(objs, writer, singular=None, plural=None): 5202 if singular is None: 5203 singular = 'ip' 5204 if plural is None: 5205 plural = 'ips' 5206 writer.write_start(plural) 5207 if isinstance(objs, List): 5208 href = objs.href 5209 if href is not None: 5210 writer.write_attribute('href', href) 5211 for obj in objs: 5212 IpWriter.write_one(obj, writer, singular) 5213 writer.write_end() 5214 5215 5216class IpAddressAssignmentWriter(Writer): 5217 5218 def __init__(self): 5219 super(IpAddressAssignmentWriter, self).__init__() 5220 5221 @staticmethod 5222 def write_one(obj, writer, singular=None): 5223 if singular is None: 5224 singular = 'ip_address_assignment' 5225 writer.write_start(singular) 5226 href = obj.href 5227 if href is not None: 5228 writer.write_attribute('href', href) 5229 if obj.assignment_method is not None: 5230 Writer.write_string(writer, 'assignment_method', obj.assignment_method.value) 5231 if obj.ip is not None: 5232 IpWriter.write_one(obj.ip, writer, 'ip') 5233 writer.write_end() 5234 5235 @staticmethod 5236 def write_many(objs, writer, singular=None, plural=None): 5237 if singular is None: 5238 singular = 'ip_address_assignment' 5239 if plural is None: 5240 plural = 'ip_address_assignments' 5241 writer.write_start(plural) 5242 if isinstance(objs, List): 5243 href = objs.href 5244 if href is not None: 5245 writer.write_attribute('href', href) 5246 for obj in objs: 5247 IpAddressAssignmentWriter.write_one(obj, writer, singular) 5248 writer.write_end() 5249 5250 5251class IscsiBondWriter(Writer): 5252 5253 def __init__(self): 5254 super(IscsiBondWriter, self).__init__() 5255 5256 @staticmethod 5257 def write_one(obj, writer, singular=None): 5258 if singular is None: 5259 singular = 'iscsi_bond' 5260 writer.write_start(singular) 5261 href = obj.href 5262 if href is not None: 5263 writer.write_attribute('href', href) 5264 if obj.id is not None: 5265 writer.write_attribute('id', obj.id) 5266 if obj.comment is not None: 5267 Writer.write_string(writer, 'comment', obj.comment) 5268 if obj.description is not None: 5269 Writer.write_string(writer, 'description', obj.description) 5270 if obj.name is not None: 5271 Writer.write_string(writer, 'name', obj.name) 5272 if obj.data_center is not None: 5273 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 5274 if obj.networks is not None: 5275 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 5276 if obj.storage_connections is not None: 5277 StorageConnectionWriter.write_many(obj.storage_connections, writer, 'storage_connection', 'storage_connections') 5278 writer.write_end() 5279 5280 @staticmethod 5281 def write_many(objs, writer, singular=None, plural=None): 5282 if singular is None: 5283 singular = 'iscsi_bond' 5284 if plural is None: 5285 plural = 'iscsi_bonds' 5286 writer.write_start(plural) 5287 if isinstance(objs, List): 5288 href = objs.href 5289 if href is not None: 5290 writer.write_attribute('href', href) 5291 for obj in objs: 5292 IscsiBondWriter.write_one(obj, writer, singular) 5293 writer.write_end() 5294 5295 5296class IscsiDetailsWriter(Writer): 5297 5298 def __init__(self): 5299 super(IscsiDetailsWriter, self).__init__() 5300 5301 @staticmethod 5302 def write_one(obj, writer, singular=None): 5303 if singular is None: 5304 singular = 'iscsi_details' 5305 writer.write_start(singular) 5306 href = obj.href 5307 if href is not None: 5308 writer.write_attribute('href', href) 5309 if obj.address is not None: 5310 Writer.write_string(writer, 'address', obj.address) 5311 if obj.disk_id is not None: 5312 Writer.write_string(writer, 'disk_id', obj.disk_id) 5313 if obj.initiator is not None: 5314 Writer.write_string(writer, 'initiator', obj.initiator) 5315 if obj.lun_mapping is not None: 5316 Writer.write_integer(writer, 'lun_mapping', obj.lun_mapping) 5317 if obj.password is not None: 5318 Writer.write_string(writer, 'password', obj.password) 5319 if obj.paths is not None: 5320 Writer.write_integer(writer, 'paths', obj.paths) 5321 if obj.port is not None: 5322 Writer.write_integer(writer, 'port', obj.port) 5323 if obj.portal is not None: 5324 Writer.write_string(writer, 'portal', obj.portal) 5325 if obj.product_id is not None: 5326 Writer.write_string(writer, 'product_id', obj.product_id) 5327 if obj.serial is not None: 5328 Writer.write_string(writer, 'serial', obj.serial) 5329 if obj.size is not None: 5330 Writer.write_integer(writer, 'size', obj.size) 5331 if obj.status is not None: 5332 Writer.write_string(writer, 'status', obj.status) 5333 if obj.storage_domain_id is not None: 5334 Writer.write_string(writer, 'storage_domain_id', obj.storage_domain_id) 5335 if obj.target is not None: 5336 Writer.write_string(writer, 'target', obj.target) 5337 if obj.username is not None: 5338 Writer.write_string(writer, 'username', obj.username) 5339 if obj.vendor_id is not None: 5340 Writer.write_string(writer, 'vendor_id', obj.vendor_id) 5341 if obj.volume_group_id is not None: 5342 Writer.write_string(writer, 'volume_group_id', obj.volume_group_id) 5343 writer.write_end() 5344 5345 @staticmethod 5346 def write_many(objs, writer, singular=None, plural=None): 5347 if singular is None: 5348 singular = 'iscsi_details' 5349 if plural is None: 5350 plural = 'iscsi_detailss' 5351 writer.write_start(plural) 5352 if isinstance(objs, List): 5353 href = objs.href 5354 if href is not None: 5355 writer.write_attribute('href', href) 5356 for obj in objs: 5357 IscsiDetailsWriter.write_one(obj, writer, singular) 5358 writer.write_end() 5359 5360 5361class JobWriter(Writer): 5362 5363 def __init__(self): 5364 super(JobWriter, self).__init__() 5365 5366 @staticmethod 5367 def write_one(obj, writer, singular=None): 5368 if singular is None: 5369 singular = 'job' 5370 writer.write_start(singular) 5371 href = obj.href 5372 if href is not None: 5373 writer.write_attribute('href', href) 5374 if obj.id is not None: 5375 writer.write_attribute('id', obj.id) 5376 if obj.auto_cleared is not None: 5377 Writer.write_boolean(writer, 'auto_cleared', obj.auto_cleared) 5378 if obj.comment is not None: 5379 Writer.write_string(writer, 'comment', obj.comment) 5380 if obj.description is not None: 5381 Writer.write_string(writer, 'description', obj.description) 5382 if obj.end_time is not None: 5383 Writer.write_date(writer, 'end_time', obj.end_time) 5384 if obj.external is not None: 5385 Writer.write_boolean(writer, 'external', obj.external) 5386 if obj.last_updated is not None: 5387 Writer.write_date(writer, 'last_updated', obj.last_updated) 5388 if obj.name is not None: 5389 Writer.write_string(writer, 'name', obj.name) 5390 if obj.start_time is not None: 5391 Writer.write_date(writer, 'start_time', obj.start_time) 5392 if obj.status is not None: 5393 Writer.write_string(writer, 'status', obj.status.value) 5394 if obj.owner is not None: 5395 UserWriter.write_one(obj.owner, writer, 'owner') 5396 if obj.steps is not None: 5397 StepWriter.write_many(obj.steps, writer, 'step', 'steps') 5398 writer.write_end() 5399 5400 @staticmethod 5401 def write_many(objs, writer, singular=None, plural=None): 5402 if singular is None: 5403 singular = 'job' 5404 if plural is None: 5405 plural = 'jobs' 5406 writer.write_start(plural) 5407 if isinstance(objs, List): 5408 href = objs.href 5409 if href is not None: 5410 writer.write_attribute('href', href) 5411 for obj in objs: 5412 JobWriter.write_one(obj, writer, singular) 5413 writer.write_end() 5414 5415 5416class KatelloErratumWriter(Writer): 5417 5418 def __init__(self): 5419 super(KatelloErratumWriter, self).__init__() 5420 5421 @staticmethod 5422 def write_one(obj, writer, singular=None): 5423 if singular is None: 5424 singular = 'katello_erratum' 5425 writer.write_start(singular) 5426 href = obj.href 5427 if href is not None: 5428 writer.write_attribute('href', href) 5429 if obj.id is not None: 5430 writer.write_attribute('id', obj.id) 5431 if obj.comment is not None: 5432 Writer.write_string(writer, 'comment', obj.comment) 5433 if obj.description is not None: 5434 Writer.write_string(writer, 'description', obj.description) 5435 if obj.issued is not None: 5436 Writer.write_date(writer, 'issued', obj.issued) 5437 if obj.name is not None: 5438 Writer.write_string(writer, 'name', obj.name) 5439 if obj.packages is not None: 5440 PackageWriter.write_many(obj.packages, writer, 'package', 'packages') 5441 if obj.severity is not None: 5442 Writer.write_string(writer, 'severity', obj.severity) 5443 if obj.solution is not None: 5444 Writer.write_string(writer, 'solution', obj.solution) 5445 if obj.summary is not None: 5446 Writer.write_string(writer, 'summary', obj.summary) 5447 if obj.title is not None: 5448 Writer.write_string(writer, 'title', obj.title) 5449 if obj.type is not None: 5450 Writer.write_string(writer, 'type', obj.type) 5451 if obj.host is not None: 5452 HostWriter.write_one(obj.host, writer, 'host') 5453 if obj.vm is not None: 5454 VmWriter.write_one(obj.vm, writer, 'vm') 5455 writer.write_end() 5456 5457 @staticmethod 5458 def write_many(objs, writer, singular=None, plural=None): 5459 if singular is None: 5460 singular = 'katello_erratum' 5461 if plural is None: 5462 plural = 'katello_errata' 5463 writer.write_start(plural) 5464 if isinstance(objs, List): 5465 href = objs.href 5466 if href is not None: 5467 writer.write_attribute('href', href) 5468 for obj in objs: 5469 KatelloErratumWriter.write_one(obj, writer, singular) 5470 writer.write_end() 5471 5472 5473class KernelWriter(Writer): 5474 5475 def __init__(self): 5476 super(KernelWriter, self).__init__() 5477 5478 @staticmethod 5479 def write_one(obj, writer, singular=None): 5480 if singular is None: 5481 singular = 'kernel' 5482 writer.write_start(singular) 5483 href = obj.href 5484 if href is not None: 5485 writer.write_attribute('href', href) 5486 if obj.version is not None: 5487 VersionWriter.write_one(obj.version, writer, 'version') 5488 writer.write_end() 5489 5490 @staticmethod 5491 def write_many(objs, writer, singular=None, plural=None): 5492 if singular is None: 5493 singular = 'kernel' 5494 if plural is None: 5495 plural = 'kernels' 5496 writer.write_start(plural) 5497 if isinstance(objs, List): 5498 href = objs.href 5499 if href is not None: 5500 writer.write_attribute('href', href) 5501 for obj in objs: 5502 KernelWriter.write_one(obj, writer, singular) 5503 writer.write_end() 5504 5505 5506class KsmWriter(Writer): 5507 5508 def __init__(self): 5509 super(KsmWriter, self).__init__() 5510 5511 @staticmethod 5512 def write_one(obj, writer, singular=None): 5513 if singular is None: 5514 singular = 'ksm' 5515 writer.write_start(singular) 5516 href = obj.href 5517 if href is not None: 5518 writer.write_attribute('href', href) 5519 if obj.enabled is not None: 5520 Writer.write_boolean(writer, 'enabled', obj.enabled) 5521 if obj.merge_across_nodes is not None: 5522 Writer.write_boolean(writer, 'merge_across_nodes', obj.merge_across_nodes) 5523 writer.write_end() 5524 5525 @staticmethod 5526 def write_many(objs, writer, singular=None, plural=None): 5527 if singular is None: 5528 singular = 'ksm' 5529 if plural is None: 5530 plural = 'ksms' 5531 writer.write_start(plural) 5532 if isinstance(objs, List): 5533 href = objs.href 5534 if href is not None: 5535 writer.write_attribute('href', href) 5536 for obj in objs: 5537 KsmWriter.write_one(obj, writer, singular) 5538 writer.write_end() 5539 5540 5541class LinkLayerDiscoveryProtocolElementWriter(Writer): 5542 5543 def __init__(self): 5544 super(LinkLayerDiscoveryProtocolElementWriter, self).__init__() 5545 5546 @staticmethod 5547 def write_one(obj, writer, singular=None): 5548 if singular is None: 5549 singular = 'link_layer_discovery_protocol_element' 5550 writer.write_start(singular) 5551 href = obj.href 5552 if href is not None: 5553 writer.write_attribute('href', href) 5554 if obj.id is not None: 5555 writer.write_attribute('id', obj.id) 5556 if obj.comment is not None: 5557 Writer.write_string(writer, 'comment', obj.comment) 5558 if obj.description is not None: 5559 Writer.write_string(writer, 'description', obj.description) 5560 if obj.name is not None: 5561 Writer.write_string(writer, 'name', obj.name) 5562 if obj.oui is not None: 5563 Writer.write_integer(writer, 'oui', obj.oui) 5564 if obj.properties is not None: 5565 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 5566 if obj.subtype is not None: 5567 Writer.write_integer(writer, 'subtype', obj.subtype) 5568 if obj.type is not None: 5569 Writer.write_integer(writer, 'type', obj.type) 5570 writer.write_end() 5571 5572 @staticmethod 5573 def write_many(objs, writer, singular=None, plural=None): 5574 if singular is None: 5575 singular = 'link_layer_discovery_protocol_element' 5576 if plural is None: 5577 plural = 'link_layer_discovery_protocol_elements' 5578 writer.write_start(plural) 5579 if isinstance(objs, List): 5580 href = objs.href 5581 if href is not None: 5582 writer.write_attribute('href', href) 5583 for obj in objs: 5584 LinkLayerDiscoveryProtocolElementWriter.write_one(obj, writer, singular) 5585 writer.write_end() 5586 5587 5588class LogicalUnitWriter(Writer): 5589 5590 def __init__(self): 5591 super(LogicalUnitWriter, self).__init__() 5592 5593 @staticmethod 5594 def write_one(obj, writer, singular=None): 5595 if singular is None: 5596 singular = 'logical_unit' 5597 writer.write_start(singular) 5598 href = obj.href 5599 if href is not None: 5600 writer.write_attribute('href', href) 5601 if obj.id is not None: 5602 writer.write_attribute('id', obj.id) 5603 if obj.active_paths is not None: 5604 Writer.write_integer(writer, 'active_paths', obj.active_paths) 5605 if obj.address is not None: 5606 Writer.write_string(writer, 'address', obj.address) 5607 if obj.discard_max_size is not None: 5608 Writer.write_integer(writer, 'discard_max_size', obj.discard_max_size) 5609 if obj.discard_zeroes_data is not None: 5610 Writer.write_boolean(writer, 'discard_zeroes_data', obj.discard_zeroes_data) 5611 if obj.disk_id is not None: 5612 Writer.write_string(writer, 'disk_id', obj.disk_id) 5613 if obj.lun_mapping is not None: 5614 Writer.write_integer(writer, 'lun_mapping', obj.lun_mapping) 5615 if obj.password is not None: 5616 Writer.write_string(writer, 'password', obj.password) 5617 if obj.paths is not None: 5618 Writer.write_integer(writer, 'paths', obj.paths) 5619 if obj.port is not None: 5620 Writer.write_integer(writer, 'port', obj.port) 5621 if obj.portal is not None: 5622 Writer.write_string(writer, 'portal', obj.portal) 5623 if obj.product_id is not None: 5624 Writer.write_string(writer, 'product_id', obj.product_id) 5625 if obj.serial is not None: 5626 Writer.write_string(writer, 'serial', obj.serial) 5627 if obj.size is not None: 5628 Writer.write_integer(writer, 'size', obj.size) 5629 if obj.status is not None: 5630 Writer.write_string(writer, 'status', obj.status.value) 5631 if obj.storage_domain_id is not None: 5632 Writer.write_string(writer, 'storage_domain_id', obj.storage_domain_id) 5633 if obj.target is not None: 5634 Writer.write_string(writer, 'target', obj.target) 5635 if obj.username is not None: 5636 Writer.write_string(writer, 'username', obj.username) 5637 if obj.vendor_id is not None: 5638 Writer.write_string(writer, 'vendor_id', obj.vendor_id) 5639 if obj.volume_group_id is not None: 5640 Writer.write_string(writer, 'volume_group_id', obj.volume_group_id) 5641 writer.write_end() 5642 5643 @staticmethod 5644 def write_many(objs, writer, singular=None, plural=None): 5645 if singular is None: 5646 singular = 'logical_unit' 5647 if plural is None: 5648 plural = 'logical_units' 5649 writer.write_start(plural) 5650 if isinstance(objs, List): 5651 href = objs.href 5652 if href is not None: 5653 writer.write_attribute('href', href) 5654 for obj in objs: 5655 LogicalUnitWriter.write_one(obj, writer, singular) 5656 writer.write_end() 5657 5658 5659class MDevTypeWriter(Writer): 5660 5661 def __init__(self): 5662 super(MDevTypeWriter, self).__init__() 5663 5664 @staticmethod 5665 def write_one(obj, writer, singular=None): 5666 if singular is None: 5667 singular = 'm_dev_type' 5668 writer.write_start(singular) 5669 href = obj.href 5670 if href is not None: 5671 writer.write_attribute('href', href) 5672 if obj.available_instances is not None: 5673 Writer.write_integer(writer, 'available_instances', obj.available_instances) 5674 if obj.description is not None: 5675 Writer.write_string(writer, 'description', obj.description) 5676 if obj.human_readable_name is not None: 5677 Writer.write_string(writer, 'human_readable_name', obj.human_readable_name) 5678 if obj.name is not None: 5679 Writer.write_string(writer, 'name', obj.name) 5680 writer.write_end() 5681 5682 @staticmethod 5683 def write_many(objs, writer, singular=None, plural=None): 5684 if singular is None: 5685 singular = 'm_dev_type' 5686 if plural is None: 5687 plural = 'm_dev_types' 5688 writer.write_start(plural) 5689 if isinstance(objs, List): 5690 href = objs.href 5691 if href is not None: 5692 writer.write_attribute('href', href) 5693 for obj in objs: 5694 MDevTypeWriter.write_one(obj, writer, singular) 5695 writer.write_end() 5696 5697 5698class MacWriter(Writer): 5699 5700 def __init__(self): 5701 super(MacWriter, self).__init__() 5702 5703 @staticmethod 5704 def write_one(obj, writer, singular=None): 5705 if singular is None: 5706 singular = 'mac' 5707 writer.write_start(singular) 5708 href = obj.href 5709 if href is not None: 5710 writer.write_attribute('href', href) 5711 if obj.address is not None: 5712 Writer.write_string(writer, 'address', obj.address) 5713 writer.write_end() 5714 5715 @staticmethod 5716 def write_many(objs, writer, singular=None, plural=None): 5717 if singular is None: 5718 singular = 'mac' 5719 if plural is None: 5720 plural = 'macs' 5721 writer.write_start(plural) 5722 if isinstance(objs, List): 5723 href = objs.href 5724 if href is not None: 5725 writer.write_attribute('href', href) 5726 for obj in objs: 5727 MacWriter.write_one(obj, writer, singular) 5728 writer.write_end() 5729 5730 5731class MacPoolWriter(Writer): 5732 5733 def __init__(self): 5734 super(MacPoolWriter, self).__init__() 5735 5736 @staticmethod 5737 def write_one(obj, writer, singular=None): 5738 if singular is None: 5739 singular = 'mac_pool' 5740 writer.write_start(singular) 5741 href = obj.href 5742 if href is not None: 5743 writer.write_attribute('href', href) 5744 if obj.id is not None: 5745 writer.write_attribute('id', obj.id) 5746 if obj.allow_duplicates is not None: 5747 Writer.write_boolean(writer, 'allow_duplicates', obj.allow_duplicates) 5748 if obj.comment is not None: 5749 Writer.write_string(writer, 'comment', obj.comment) 5750 if obj.default_pool is not None: 5751 Writer.write_boolean(writer, 'default_pool', obj.default_pool) 5752 if obj.description is not None: 5753 Writer.write_string(writer, 'description', obj.description) 5754 if obj.name is not None: 5755 Writer.write_string(writer, 'name', obj.name) 5756 if obj.ranges is not None: 5757 RangeWriter.write_many(obj.ranges, writer, 'range', 'ranges') 5758 if obj.permissions is not None: 5759 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 5760 writer.write_end() 5761 5762 @staticmethod 5763 def write_many(objs, writer, singular=None, plural=None): 5764 if singular is None: 5765 singular = 'mac_pool' 5766 if plural is None: 5767 plural = 'mac_pools' 5768 writer.write_start(plural) 5769 if isinstance(objs, List): 5770 href = objs.href 5771 if href is not None: 5772 writer.write_attribute('href', href) 5773 for obj in objs: 5774 MacPoolWriter.write_one(obj, writer, singular) 5775 writer.write_end() 5776 5777 5778class MemoryOverCommitWriter(Writer): 5779 5780 def __init__(self): 5781 super(MemoryOverCommitWriter, self).__init__() 5782 5783 @staticmethod 5784 def write_one(obj, writer, singular=None): 5785 if singular is None: 5786 singular = 'memory_over_commit' 5787 writer.write_start(singular) 5788 href = obj.href 5789 if href is not None: 5790 writer.write_attribute('href', href) 5791 if obj.percent is not None: 5792 Writer.write_integer(writer, 'percent', obj.percent) 5793 writer.write_end() 5794 5795 @staticmethod 5796 def write_many(objs, writer, singular=None, plural=None): 5797 if singular is None: 5798 singular = 'memory_over_commit' 5799 if plural is None: 5800 plural = 'memory_over_commits' 5801 writer.write_start(plural) 5802 if isinstance(objs, List): 5803 href = objs.href 5804 if href is not None: 5805 writer.write_attribute('href', href) 5806 for obj in objs: 5807 MemoryOverCommitWriter.write_one(obj, writer, singular) 5808 writer.write_end() 5809 5810 5811class MemoryPolicyWriter(Writer): 5812 5813 def __init__(self): 5814 super(MemoryPolicyWriter, self).__init__() 5815 5816 @staticmethod 5817 def write_one(obj, writer, singular=None): 5818 if singular is None: 5819 singular = 'memory_policy' 5820 writer.write_start(singular) 5821 href = obj.href 5822 if href is not None: 5823 writer.write_attribute('href', href) 5824 if obj.ballooning is not None: 5825 Writer.write_boolean(writer, 'ballooning', obj.ballooning) 5826 if obj.guaranteed is not None: 5827 Writer.write_integer(writer, 'guaranteed', obj.guaranteed) 5828 if obj.max is not None: 5829 Writer.write_integer(writer, 'max', obj.max) 5830 if obj.over_commit is not None: 5831 MemoryOverCommitWriter.write_one(obj.over_commit, writer, 'over_commit') 5832 if obj.transparent_huge_pages is not None: 5833 TransparentHugePagesWriter.write_one(obj.transparent_huge_pages, writer, 'transparent_hugepages') 5834 writer.write_end() 5835 5836 @staticmethod 5837 def write_many(objs, writer, singular=None, plural=None): 5838 if singular is None: 5839 singular = 'memory_policy' 5840 if plural is None: 5841 plural = 'memory_policies' 5842 writer.write_start(plural) 5843 if isinstance(objs, List): 5844 href = objs.href 5845 if href is not None: 5846 writer.write_attribute('href', href) 5847 for obj in objs: 5848 MemoryPolicyWriter.write_one(obj, writer, singular) 5849 writer.write_end() 5850 5851 5852class MethodWriter(Writer): 5853 5854 def __init__(self): 5855 super(MethodWriter, self).__init__() 5856 5857 @staticmethod 5858 def write_one(obj, writer, singular=None): 5859 if singular is None: 5860 singular = 'method' 5861 writer.write_start(singular) 5862 href = obj.href 5863 if href is not None: 5864 writer.write_attribute('href', href) 5865 if obj.id is not None: 5866 writer.write_attribute('id', obj.id.value) 5867 writer.write_end() 5868 5869 @staticmethod 5870 def write_many(objs, writer, singular=None, plural=None): 5871 if singular is None: 5872 singular = 'method' 5873 if plural is None: 5874 plural = 'methods' 5875 writer.write_start(plural) 5876 if isinstance(objs, List): 5877 href = objs.href 5878 if href is not None: 5879 writer.write_attribute('href', href) 5880 for obj in objs: 5881 MethodWriter.write_one(obj, writer, singular) 5882 writer.write_end() 5883 5884 5885class MigrationBandwidthWriter(Writer): 5886 5887 def __init__(self): 5888 super(MigrationBandwidthWriter, self).__init__() 5889 5890 @staticmethod 5891 def write_one(obj, writer, singular=None): 5892 if singular is None: 5893 singular = 'migration_bandwidth' 5894 writer.write_start(singular) 5895 href = obj.href 5896 if href is not None: 5897 writer.write_attribute('href', href) 5898 if obj.assignment_method is not None: 5899 Writer.write_string(writer, 'assignment_method', obj.assignment_method.value) 5900 if obj.custom_value is not None: 5901 Writer.write_integer(writer, 'custom_value', obj.custom_value) 5902 writer.write_end() 5903 5904 @staticmethod 5905 def write_many(objs, writer, singular=None, plural=None): 5906 if singular is None: 5907 singular = 'migration_bandwidth' 5908 if plural is None: 5909 plural = 'migration_bandwidths' 5910 writer.write_start(plural) 5911 if isinstance(objs, List): 5912 href = objs.href 5913 if href is not None: 5914 writer.write_attribute('href', href) 5915 for obj in objs: 5916 MigrationBandwidthWriter.write_one(obj, writer, singular) 5917 writer.write_end() 5918 5919 5920class MigrationOptionsWriter(Writer): 5921 5922 def __init__(self): 5923 super(MigrationOptionsWriter, self).__init__() 5924 5925 @staticmethod 5926 def write_one(obj, writer, singular=None): 5927 if singular is None: 5928 singular = 'migration' 5929 writer.write_start(singular) 5930 href = obj.href 5931 if href is not None: 5932 writer.write_attribute('href', href) 5933 if obj.auto_converge is not None: 5934 Writer.write_string(writer, 'auto_converge', obj.auto_converge.value) 5935 if obj.bandwidth is not None: 5936 MigrationBandwidthWriter.write_one(obj.bandwidth, writer, 'bandwidth') 5937 if obj.compressed is not None: 5938 Writer.write_string(writer, 'compressed', obj.compressed.value) 5939 if obj.custom_parallel_migrations is not None: 5940 Writer.write_integer(writer, 'custom_parallel_migrations', obj.custom_parallel_migrations) 5941 if obj.encrypted is not None: 5942 Writer.write_string(writer, 'encrypted', obj.encrypted.value) 5943 if obj.parallel_migrations_policy is not None: 5944 Writer.write_string(writer, 'parallel_migrations_policy', obj.parallel_migrations_policy.value) 5945 if obj.policy is not None: 5946 MigrationPolicyWriter.write_one(obj.policy, writer, 'policy') 5947 writer.write_end() 5948 5949 @staticmethod 5950 def write_many(objs, writer, singular=None, plural=None): 5951 if singular is None: 5952 singular = 'migration' 5953 if plural is None: 5954 plural = 'migration_optionss' 5955 writer.write_start(plural) 5956 if isinstance(objs, List): 5957 href = objs.href 5958 if href is not None: 5959 writer.write_attribute('href', href) 5960 for obj in objs: 5961 MigrationOptionsWriter.write_one(obj, writer, singular) 5962 writer.write_end() 5963 5964 5965class MigrationPolicyWriter(Writer): 5966 5967 def __init__(self): 5968 super(MigrationPolicyWriter, self).__init__() 5969 5970 @staticmethod 5971 def write_one(obj, writer, singular=None): 5972 if singular is None: 5973 singular = 'migration_policy' 5974 writer.write_start(singular) 5975 href = obj.href 5976 if href is not None: 5977 writer.write_attribute('href', href) 5978 if obj.id is not None: 5979 writer.write_attribute('id', obj.id) 5980 if obj.comment is not None: 5981 Writer.write_string(writer, 'comment', obj.comment) 5982 if obj.description is not None: 5983 Writer.write_string(writer, 'description', obj.description) 5984 if obj.name is not None: 5985 Writer.write_string(writer, 'name', obj.name) 5986 writer.write_end() 5987 5988 @staticmethod 5989 def write_many(objs, writer, singular=None, plural=None): 5990 if singular is None: 5991 singular = 'migration_policy' 5992 if plural is None: 5993 plural = 'migration_policies' 5994 writer.write_start(plural) 5995 if isinstance(objs, List): 5996 href = objs.href 5997 if href is not None: 5998 writer.write_attribute('href', href) 5999 for obj in objs: 6000 MigrationPolicyWriter.write_one(obj, writer, singular) 6001 writer.write_end() 6002 6003 6004class NetworkWriter(Writer): 6005 6006 def __init__(self): 6007 super(NetworkWriter, self).__init__() 6008 6009 @staticmethod 6010 def write_one(obj, writer, singular=None): 6011 if singular is None: 6012 singular = 'network' 6013 writer.write_start(singular) 6014 href = obj.href 6015 if href is not None: 6016 writer.write_attribute('href', href) 6017 if obj.id is not None: 6018 writer.write_attribute('id', obj.id) 6019 if obj.comment is not None: 6020 Writer.write_string(writer, 'comment', obj.comment) 6021 if obj.description is not None: 6022 Writer.write_string(writer, 'description', obj.description) 6023 if obj.display is not None: 6024 Writer.write_boolean(writer, 'display', obj.display) 6025 if obj.dns_resolver_configuration is not None: 6026 DnsResolverConfigurationWriter.write_one(obj.dns_resolver_configuration, writer, 'dns_resolver_configuration') 6027 if obj.ip is not None: 6028 IpWriter.write_one(obj.ip, writer, 'ip') 6029 if obj.mtu is not None: 6030 Writer.write_integer(writer, 'mtu', obj.mtu) 6031 if obj.name is not None: 6032 Writer.write_string(writer, 'name', obj.name) 6033 if obj.port_isolation is not None: 6034 Writer.write_boolean(writer, 'port_isolation', obj.port_isolation) 6035 if obj.profile_required is not None: 6036 Writer.write_boolean(writer, 'profile_required', obj.profile_required) 6037 if obj.required is not None: 6038 Writer.write_boolean(writer, 'required', obj.required) 6039 if obj.status is not None: 6040 Writer.write_string(writer, 'status', obj.status.value) 6041 if obj.stp is not None: 6042 Writer.write_boolean(writer, 'stp', obj.stp) 6043 if obj.usages is not None: 6044 writer.write_start('usages') 6045 for item in obj.usages: 6046 if item is not None: 6047 Writer.write_string(writer, 'usage', item.value) 6048 writer.write_end() 6049 if obj.vdsm_name is not None: 6050 Writer.write_string(writer, 'vdsm_name', obj.vdsm_name) 6051 if obj.vlan is not None: 6052 VlanWriter.write_one(obj.vlan, writer, 'vlan') 6053 if obj.cluster is not None: 6054 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 6055 if obj.data_center is not None: 6056 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 6057 if obj.external_provider is not None: 6058 OpenStackNetworkProviderWriter.write_one(obj.external_provider, writer, 'external_provider') 6059 if obj.external_provider_physical_network is not None: 6060 NetworkWriter.write_one(obj.external_provider_physical_network, writer, 'external_provider_physical_network') 6061 if obj.network_labels is not None: 6062 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 6063 if obj.permissions is not None: 6064 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 6065 if obj.qos is not None: 6066 QosWriter.write_one(obj.qos, writer, 'qos') 6067 if obj.vnic_profiles is not None: 6068 VnicProfileWriter.write_many(obj.vnic_profiles, writer, 'vnic_profile', 'vnic_profiles') 6069 writer.write_end() 6070 6071 @staticmethod 6072 def write_many(objs, writer, singular=None, plural=None): 6073 if singular is None: 6074 singular = 'network' 6075 if plural is None: 6076 plural = 'networks' 6077 writer.write_start(plural) 6078 if isinstance(objs, List): 6079 href = objs.href 6080 if href is not None: 6081 writer.write_attribute('href', href) 6082 for obj in objs: 6083 NetworkWriter.write_one(obj, writer, singular) 6084 writer.write_end() 6085 6086 6087class NetworkAttachmentWriter(Writer): 6088 6089 def __init__(self): 6090 super(NetworkAttachmentWriter, self).__init__() 6091 6092 @staticmethod 6093 def write_one(obj, writer, singular=None): 6094 if singular is None: 6095 singular = 'network_attachment' 6096 writer.write_start(singular) 6097 href = obj.href 6098 if href is not None: 6099 writer.write_attribute('href', href) 6100 if obj.id is not None: 6101 writer.write_attribute('id', obj.id) 6102 if obj.comment is not None: 6103 Writer.write_string(writer, 'comment', obj.comment) 6104 if obj.description is not None: 6105 Writer.write_string(writer, 'description', obj.description) 6106 if obj.dns_resolver_configuration is not None: 6107 DnsResolverConfigurationWriter.write_one(obj.dns_resolver_configuration, writer, 'dns_resolver_configuration') 6108 if obj.in_sync is not None: 6109 Writer.write_boolean(writer, 'in_sync', obj.in_sync) 6110 if obj.ip_address_assignments is not None: 6111 IpAddressAssignmentWriter.write_many(obj.ip_address_assignments, writer, 'ip_address_assignment', 'ip_address_assignments') 6112 if obj.name is not None: 6113 Writer.write_string(writer, 'name', obj.name) 6114 if obj.properties is not None: 6115 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6116 if obj.reported_configurations is not None: 6117 ReportedConfigurationWriter.write_many(obj.reported_configurations, writer, 'reported_configuration', 'reported_configurations') 6118 if obj.host is not None: 6119 HostWriter.write_one(obj.host, writer, 'host') 6120 if obj.host_nic is not None: 6121 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 6122 if obj.network is not None: 6123 NetworkWriter.write_one(obj.network, writer, 'network') 6124 if obj.qos is not None: 6125 QosWriter.write_one(obj.qos, writer, 'qos') 6126 writer.write_end() 6127 6128 @staticmethod 6129 def write_many(objs, writer, singular=None, plural=None): 6130 if singular is None: 6131 singular = 'network_attachment' 6132 if plural is None: 6133 plural = 'network_attachments' 6134 writer.write_start(plural) 6135 if isinstance(objs, List): 6136 href = objs.href 6137 if href is not None: 6138 writer.write_attribute('href', href) 6139 for obj in objs: 6140 NetworkAttachmentWriter.write_one(obj, writer, singular) 6141 writer.write_end() 6142 6143 6144class NetworkConfigurationWriter(Writer): 6145 6146 def __init__(self): 6147 super(NetworkConfigurationWriter, self).__init__() 6148 6149 @staticmethod 6150 def write_one(obj, writer, singular=None): 6151 if singular is None: 6152 singular = 'network_configuration' 6153 writer.write_start(singular) 6154 href = obj.href 6155 if href is not None: 6156 writer.write_attribute('href', href) 6157 if obj.dns is not None: 6158 DnsWriter.write_one(obj.dns, writer, 'dns') 6159 if obj.nics is not None: 6160 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 6161 writer.write_end() 6162 6163 @staticmethod 6164 def write_many(objs, writer, singular=None, plural=None): 6165 if singular is None: 6166 singular = 'network_configuration' 6167 if plural is None: 6168 plural = 'network_configurations' 6169 writer.write_start(plural) 6170 if isinstance(objs, List): 6171 href = objs.href 6172 if href is not None: 6173 writer.write_attribute('href', href) 6174 for obj in objs: 6175 NetworkConfigurationWriter.write_one(obj, writer, singular) 6176 writer.write_end() 6177 6178 6179class NetworkFilterWriter(Writer): 6180 6181 def __init__(self): 6182 super(NetworkFilterWriter, self).__init__() 6183 6184 @staticmethod 6185 def write_one(obj, writer, singular=None): 6186 if singular is None: 6187 singular = 'network_filter' 6188 writer.write_start(singular) 6189 href = obj.href 6190 if href is not None: 6191 writer.write_attribute('href', href) 6192 if obj.id is not None: 6193 writer.write_attribute('id', obj.id) 6194 if obj.comment is not None: 6195 Writer.write_string(writer, 'comment', obj.comment) 6196 if obj.description is not None: 6197 Writer.write_string(writer, 'description', obj.description) 6198 if obj.name is not None: 6199 Writer.write_string(writer, 'name', obj.name) 6200 if obj.version is not None: 6201 VersionWriter.write_one(obj.version, writer, 'version') 6202 writer.write_end() 6203 6204 @staticmethod 6205 def write_many(objs, writer, singular=None, plural=None): 6206 if singular is None: 6207 singular = 'network_filter' 6208 if plural is None: 6209 plural = 'network_filters' 6210 writer.write_start(plural) 6211 if isinstance(objs, List): 6212 href = objs.href 6213 if href is not None: 6214 writer.write_attribute('href', href) 6215 for obj in objs: 6216 NetworkFilterWriter.write_one(obj, writer, singular) 6217 writer.write_end() 6218 6219 6220class NetworkFilterParameterWriter(Writer): 6221 6222 def __init__(self): 6223 super(NetworkFilterParameterWriter, self).__init__() 6224 6225 @staticmethod 6226 def write_one(obj, writer, singular=None): 6227 if singular is None: 6228 singular = 'network_filter_parameter' 6229 writer.write_start(singular) 6230 href = obj.href 6231 if href is not None: 6232 writer.write_attribute('href', href) 6233 if obj.id is not None: 6234 writer.write_attribute('id', obj.id) 6235 if obj.comment is not None: 6236 Writer.write_string(writer, 'comment', obj.comment) 6237 if obj.description is not None: 6238 Writer.write_string(writer, 'description', obj.description) 6239 if obj.name is not None: 6240 Writer.write_string(writer, 'name', obj.name) 6241 if obj.value is not None: 6242 Writer.write_string(writer, 'value', obj.value) 6243 if obj.nic is not None: 6244 NicWriter.write_one(obj.nic, writer, 'nic') 6245 writer.write_end() 6246 6247 @staticmethod 6248 def write_many(objs, writer, singular=None, plural=None): 6249 if singular is None: 6250 singular = 'network_filter_parameter' 6251 if plural is None: 6252 plural = 'network_filter_parameters' 6253 writer.write_start(plural) 6254 if isinstance(objs, List): 6255 href = objs.href 6256 if href is not None: 6257 writer.write_attribute('href', href) 6258 for obj in objs: 6259 NetworkFilterParameterWriter.write_one(obj, writer, singular) 6260 writer.write_end() 6261 6262 6263class NetworkLabelWriter(Writer): 6264 6265 def __init__(self): 6266 super(NetworkLabelWriter, self).__init__() 6267 6268 @staticmethod 6269 def write_one(obj, writer, singular=None): 6270 if singular is None: 6271 singular = 'network_label' 6272 writer.write_start(singular) 6273 href = obj.href 6274 if href is not None: 6275 writer.write_attribute('href', href) 6276 if obj.id is not None: 6277 writer.write_attribute('id', obj.id) 6278 if obj.comment is not None: 6279 Writer.write_string(writer, 'comment', obj.comment) 6280 if obj.description is not None: 6281 Writer.write_string(writer, 'description', obj.description) 6282 if obj.name is not None: 6283 Writer.write_string(writer, 'name', obj.name) 6284 if obj.host_nic is not None: 6285 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 6286 if obj.network is not None: 6287 NetworkWriter.write_one(obj.network, writer, 'network') 6288 writer.write_end() 6289 6290 @staticmethod 6291 def write_many(objs, writer, singular=None, plural=None): 6292 if singular is None: 6293 singular = 'network_label' 6294 if plural is None: 6295 plural = 'network_labels' 6296 writer.write_start(plural) 6297 if isinstance(objs, List): 6298 href = objs.href 6299 if href is not None: 6300 writer.write_attribute('href', href) 6301 for obj in objs: 6302 NetworkLabelWriter.write_one(obj, writer, singular) 6303 writer.write_end() 6304 6305 6306class NfsProfileDetailWriter(Writer): 6307 6308 def __init__(self): 6309 super(NfsProfileDetailWriter, self).__init__() 6310 6311 @staticmethod 6312 def write_one(obj, writer, singular=None): 6313 if singular is None: 6314 singular = 'nfs_profile_detail' 6315 writer.write_start(singular) 6316 href = obj.href 6317 if href is not None: 6318 writer.write_attribute('href', href) 6319 if obj.nfs_server_ip is not None: 6320 Writer.write_string(writer, 'nfs_server_ip', obj.nfs_server_ip) 6321 if obj.profile_details is not None: 6322 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 6323 writer.write_end() 6324 6325 @staticmethod 6326 def write_many(objs, writer, singular=None, plural=None): 6327 if singular is None: 6328 singular = 'nfs_profile_detail' 6329 if plural is None: 6330 plural = 'nfs_profile_details' 6331 writer.write_start(plural) 6332 if isinstance(objs, List): 6333 href = objs.href 6334 if href is not None: 6335 writer.write_attribute('href', href) 6336 for obj in objs: 6337 NfsProfileDetailWriter.write_one(obj, writer, singular) 6338 writer.write_end() 6339 6340 6341class NicWriter(Writer): 6342 6343 def __init__(self): 6344 super(NicWriter, self).__init__() 6345 6346 @staticmethod 6347 def write_one(obj, writer, singular=None): 6348 if singular is None: 6349 singular = 'nic' 6350 writer.write_start(singular) 6351 href = obj.href 6352 if href is not None: 6353 writer.write_attribute('href', href) 6354 if obj.id is not None: 6355 writer.write_attribute('id', obj.id) 6356 if obj.boot_protocol is not None: 6357 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 6358 if obj.comment is not None: 6359 Writer.write_string(writer, 'comment', obj.comment) 6360 if obj.description is not None: 6361 Writer.write_string(writer, 'description', obj.description) 6362 if obj.interface is not None: 6363 Writer.write_string(writer, 'interface', obj.interface.value) 6364 if obj.linked is not None: 6365 Writer.write_boolean(writer, 'linked', obj.linked) 6366 if obj.mac is not None: 6367 MacWriter.write_one(obj.mac, writer, 'mac') 6368 if obj.name is not None: 6369 Writer.write_string(writer, 'name', obj.name) 6370 if obj.on_boot is not None: 6371 Writer.write_boolean(writer, 'on_boot', obj.on_boot) 6372 if obj.plugged is not None: 6373 Writer.write_boolean(writer, 'plugged', obj.plugged) 6374 if obj.synced is not None: 6375 Writer.write_boolean(writer, 'synced', obj.synced) 6376 if obj.instance_type is not None: 6377 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 6378 if obj.network is not None: 6379 NetworkWriter.write_one(obj.network, writer, 'network') 6380 if obj.network_attachments is not None: 6381 NetworkAttachmentWriter.write_many(obj.network_attachments, writer, 'network_attachment', 'network_attachments') 6382 if obj.network_filter_parameters is not None: 6383 NetworkFilterParameterWriter.write_many(obj.network_filter_parameters, writer, 'network_filter_parameter', 'network_filter_parameters') 6384 if obj.network_labels is not None: 6385 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 6386 if obj.reported_devices is not None: 6387 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 6388 if obj.statistics is not None: 6389 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 6390 if obj.template is not None: 6391 TemplateWriter.write_one(obj.template, writer, 'template') 6392 if obj.virtual_function_allowed_labels is not None: 6393 NetworkLabelWriter.write_many(obj.virtual_function_allowed_labels, writer, 'network_label', 'virtual_function_allowed_labels') 6394 if obj.virtual_function_allowed_networks is not None: 6395 NetworkWriter.write_many(obj.virtual_function_allowed_networks, writer, 'network', 'virtual_function_allowed_networks') 6396 if obj.vm is not None: 6397 VmWriter.write_one(obj.vm, writer, 'vm') 6398 if obj.vms is not None: 6399 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 6400 if obj.vnic_profile is not None: 6401 VnicProfileWriter.write_one(obj.vnic_profile, writer, 'vnic_profile') 6402 writer.write_end() 6403 6404 @staticmethod 6405 def write_many(objs, writer, singular=None, plural=None): 6406 if singular is None: 6407 singular = 'nic' 6408 if plural is None: 6409 plural = 'nics' 6410 writer.write_start(plural) 6411 if isinstance(objs, List): 6412 href = objs.href 6413 if href is not None: 6414 writer.write_attribute('href', href) 6415 for obj in objs: 6416 NicWriter.write_one(obj, writer, singular) 6417 writer.write_end() 6418 6419 6420class NicConfigurationWriter(Writer): 6421 6422 def __init__(self): 6423 super(NicConfigurationWriter, self).__init__() 6424 6425 @staticmethod 6426 def write_one(obj, writer, singular=None): 6427 if singular is None: 6428 singular = 'nic_configuration' 6429 writer.write_start(singular) 6430 href = obj.href 6431 if href is not None: 6432 writer.write_attribute('href', href) 6433 if obj.boot_protocol is not None: 6434 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 6435 if obj.ip is not None: 6436 IpWriter.write_one(obj.ip, writer, 'ip') 6437 if obj.ipv6 is not None: 6438 IpWriter.write_one(obj.ipv6, writer, 'ipv6') 6439 if obj.ipv6_boot_protocol is not None: 6440 Writer.write_string(writer, 'ipv6_boot_protocol', obj.ipv6_boot_protocol.value) 6441 if obj.name is not None: 6442 Writer.write_string(writer, 'name', obj.name) 6443 if obj.on_boot is not None: 6444 Writer.write_boolean(writer, 'on_boot', obj.on_boot) 6445 writer.write_end() 6446 6447 @staticmethod 6448 def write_many(objs, writer, singular=None, plural=None): 6449 if singular is None: 6450 singular = 'nic_configuration' 6451 if plural is None: 6452 plural = 'nic_configurations' 6453 writer.write_start(plural) 6454 if isinstance(objs, List): 6455 href = objs.href 6456 if href is not None: 6457 writer.write_attribute('href', href) 6458 for obj in objs: 6459 NicConfigurationWriter.write_one(obj, writer, singular) 6460 writer.write_end() 6461 6462 6463class NumaNodeWriter(Writer): 6464 6465 def __init__(self): 6466 super(NumaNodeWriter, self).__init__() 6467 6468 @staticmethod 6469 def write_one(obj, writer, singular=None): 6470 if singular is None: 6471 singular = 'host_numa_node' 6472 writer.write_start(singular) 6473 href = obj.href 6474 if href is not None: 6475 writer.write_attribute('href', href) 6476 if obj.id is not None: 6477 writer.write_attribute('id', obj.id) 6478 if obj.comment is not None: 6479 Writer.write_string(writer, 'comment', obj.comment) 6480 if obj.cpu is not None: 6481 CpuWriter.write_one(obj.cpu, writer, 'cpu') 6482 if obj.description is not None: 6483 Writer.write_string(writer, 'description', obj.description) 6484 if obj.index is not None: 6485 Writer.write_integer(writer, 'index', obj.index) 6486 if obj.memory is not None: 6487 Writer.write_integer(writer, 'memory', obj.memory) 6488 if obj.name is not None: 6489 Writer.write_string(writer, 'name', obj.name) 6490 if obj.node_distance is not None: 6491 Writer.write_string(writer, 'node_distance', obj.node_distance) 6492 if obj.host is not None: 6493 HostWriter.write_one(obj.host, writer, 'host') 6494 if obj.statistics is not None: 6495 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 6496 writer.write_end() 6497 6498 @staticmethod 6499 def write_many(objs, writer, singular=None, plural=None): 6500 if singular is None: 6501 singular = 'host_numa_node' 6502 if plural is None: 6503 plural = 'host_numa_nodes' 6504 writer.write_start(plural) 6505 if isinstance(objs, List): 6506 href = objs.href 6507 if href is not None: 6508 writer.write_attribute('href', href) 6509 for obj in objs: 6510 NumaNodeWriter.write_one(obj, writer, singular) 6511 writer.write_end() 6512 6513 6514class NumaNodePinWriter(Writer): 6515 6516 def __init__(self): 6517 super(NumaNodePinWriter, self).__init__() 6518 6519 @staticmethod 6520 def write_one(obj, writer, singular=None): 6521 if singular is None: 6522 singular = 'numa_node_pin' 6523 writer.write_start(singular) 6524 href = obj.href 6525 if href is not None: 6526 writer.write_attribute('href', href) 6527 if obj.host_numa_node is not None: 6528 NumaNodeWriter.write_one(obj.host_numa_node, writer, 'host_numa_node') 6529 if obj.index is not None: 6530 Writer.write_integer(writer, 'index', obj.index) 6531 if obj.pinned is not None: 6532 Writer.write_boolean(writer, 'pinned', obj.pinned) 6533 writer.write_end() 6534 6535 @staticmethod 6536 def write_many(objs, writer, singular=None, plural=None): 6537 if singular is None: 6538 singular = 'numa_node_pin' 6539 if plural is None: 6540 plural = 'numa_node_pins' 6541 writer.write_start(plural) 6542 if isinstance(objs, List): 6543 href = objs.href 6544 if href is not None: 6545 writer.write_attribute('href', href) 6546 for obj in objs: 6547 NumaNodePinWriter.write_one(obj, writer, singular) 6548 writer.write_end() 6549 6550 6551class OpenStackImageWriter(Writer): 6552 6553 def __init__(self): 6554 super(OpenStackImageWriter, self).__init__() 6555 6556 @staticmethod 6557 def write_one(obj, writer, singular=None): 6558 if singular is None: 6559 singular = 'openstack_image' 6560 writer.write_start(singular) 6561 href = obj.href 6562 if href is not None: 6563 writer.write_attribute('href', href) 6564 if obj.id is not None: 6565 writer.write_attribute('id', obj.id) 6566 if obj.comment is not None: 6567 Writer.write_string(writer, 'comment', obj.comment) 6568 if obj.description is not None: 6569 Writer.write_string(writer, 'description', obj.description) 6570 if obj.name is not None: 6571 Writer.write_string(writer, 'name', obj.name) 6572 if obj.openstack_image_provider is not None: 6573 OpenStackImageProviderWriter.write_one(obj.openstack_image_provider, writer, 'openstack_image_provider') 6574 writer.write_end() 6575 6576 @staticmethod 6577 def write_many(objs, writer, singular=None, plural=None): 6578 if singular is None: 6579 singular = 'openstack_image' 6580 if plural is None: 6581 plural = 'openstack_images' 6582 writer.write_start(plural) 6583 if isinstance(objs, List): 6584 href = objs.href 6585 if href is not None: 6586 writer.write_attribute('href', href) 6587 for obj in objs: 6588 OpenStackImageWriter.write_one(obj, writer, singular) 6589 writer.write_end() 6590 6591 6592class OpenStackImageProviderWriter(Writer): 6593 6594 def __init__(self): 6595 super(OpenStackImageProviderWriter, self).__init__() 6596 6597 @staticmethod 6598 def write_one(obj, writer, singular=None): 6599 if singular is None: 6600 singular = 'openstack_image_provider' 6601 writer.write_start(singular) 6602 href = obj.href 6603 if href is not None: 6604 writer.write_attribute('href', href) 6605 if obj.id is not None: 6606 writer.write_attribute('id', obj.id) 6607 if obj.authentication_url is not None: 6608 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6609 if obj.comment is not None: 6610 Writer.write_string(writer, 'comment', obj.comment) 6611 if obj.description is not None: 6612 Writer.write_string(writer, 'description', obj.description) 6613 if obj.name is not None: 6614 Writer.write_string(writer, 'name', obj.name) 6615 if obj.password is not None: 6616 Writer.write_string(writer, 'password', obj.password) 6617 if obj.properties is not None: 6618 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6619 if obj.requires_authentication is not None: 6620 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6621 if obj.tenant_name is not None: 6622 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6623 if obj.url is not None: 6624 Writer.write_string(writer, 'url', obj.url) 6625 if obj.username is not None: 6626 Writer.write_string(writer, 'username', obj.username) 6627 if obj.certificates is not None: 6628 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6629 if obj.images is not None: 6630 OpenStackImageWriter.write_many(obj.images, writer, 'openstack_image', 'images') 6631 writer.write_end() 6632 6633 @staticmethod 6634 def write_many(objs, writer, singular=None, plural=None): 6635 if singular is None: 6636 singular = 'openstack_image_provider' 6637 if plural is None: 6638 plural = 'openstack_image_providers' 6639 writer.write_start(plural) 6640 if isinstance(objs, List): 6641 href = objs.href 6642 if href is not None: 6643 writer.write_attribute('href', href) 6644 for obj in objs: 6645 OpenStackImageProviderWriter.write_one(obj, writer, singular) 6646 writer.write_end() 6647 6648 6649class OpenStackNetworkWriter(Writer): 6650 6651 def __init__(self): 6652 super(OpenStackNetworkWriter, self).__init__() 6653 6654 @staticmethod 6655 def write_one(obj, writer, singular=None): 6656 if singular is None: 6657 singular = 'openstack_network' 6658 writer.write_start(singular) 6659 href = obj.href 6660 if href is not None: 6661 writer.write_attribute('href', href) 6662 if obj.id is not None: 6663 writer.write_attribute('id', obj.id) 6664 if obj.comment is not None: 6665 Writer.write_string(writer, 'comment', obj.comment) 6666 if obj.description is not None: 6667 Writer.write_string(writer, 'description', obj.description) 6668 if obj.name is not None: 6669 Writer.write_string(writer, 'name', obj.name) 6670 if obj.openstack_network_provider is not None: 6671 OpenStackNetworkProviderWriter.write_one(obj.openstack_network_provider, writer, 'openstack_network_provider') 6672 writer.write_end() 6673 6674 @staticmethod 6675 def write_many(objs, writer, singular=None, plural=None): 6676 if singular is None: 6677 singular = 'openstack_network' 6678 if plural is None: 6679 plural = 'openstack_networks' 6680 writer.write_start(plural) 6681 if isinstance(objs, List): 6682 href = objs.href 6683 if href is not None: 6684 writer.write_attribute('href', href) 6685 for obj in objs: 6686 OpenStackNetworkWriter.write_one(obj, writer, singular) 6687 writer.write_end() 6688 6689 6690class OpenStackNetworkProviderWriter(Writer): 6691 6692 def __init__(self): 6693 super(OpenStackNetworkProviderWriter, self).__init__() 6694 6695 @staticmethod 6696 def write_one(obj, writer, singular=None): 6697 if singular is None: 6698 singular = 'openstack_network_provider' 6699 writer.write_start(singular) 6700 href = obj.href 6701 if href is not None: 6702 writer.write_attribute('href', href) 6703 if obj.id is not None: 6704 writer.write_attribute('id', obj.id) 6705 if obj.agent_configuration is not None: 6706 AgentConfigurationWriter.write_one(obj.agent_configuration, writer, 'agent_configuration') 6707 if obj.authentication_url is not None: 6708 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6709 if obj.auto_sync is not None: 6710 Writer.write_boolean(writer, 'auto_sync', obj.auto_sync) 6711 if obj.comment is not None: 6712 Writer.write_string(writer, 'comment', obj.comment) 6713 if obj.description is not None: 6714 Writer.write_string(writer, 'description', obj.description) 6715 if obj.external_plugin_type is not None: 6716 Writer.write_string(writer, 'external_plugin_type', obj.external_plugin_type) 6717 if obj.name is not None: 6718 Writer.write_string(writer, 'name', obj.name) 6719 if obj.password is not None: 6720 Writer.write_string(writer, 'password', obj.password) 6721 if obj.plugin_type is not None: 6722 Writer.write_string(writer, 'plugin_type', obj.plugin_type.value) 6723 if obj.project_domain_name is not None: 6724 Writer.write_string(writer, 'project_domain_name', obj.project_domain_name) 6725 if obj.project_name is not None: 6726 Writer.write_string(writer, 'project_name', obj.project_name) 6727 if obj.properties is not None: 6728 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6729 if obj.read_only is not None: 6730 Writer.write_boolean(writer, 'read_only', obj.read_only) 6731 if obj.requires_authentication is not None: 6732 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6733 if obj.tenant_name is not None: 6734 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6735 if obj.type is not None: 6736 Writer.write_string(writer, 'type', obj.type.value) 6737 if obj.unmanaged is not None: 6738 Writer.write_boolean(writer, 'unmanaged', obj.unmanaged) 6739 if obj.url is not None: 6740 Writer.write_string(writer, 'url', obj.url) 6741 if obj.user_domain_name is not None: 6742 Writer.write_string(writer, 'user_domain_name', obj.user_domain_name) 6743 if obj.username is not None: 6744 Writer.write_string(writer, 'username', obj.username) 6745 if obj.certificates is not None: 6746 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6747 if obj.networks is not None: 6748 OpenStackNetworkWriter.write_many(obj.networks, writer, 'openstack_network', 'networks') 6749 if obj.subnets is not None: 6750 OpenStackSubnetWriter.write_many(obj.subnets, writer, 'openstack_subnet', 'subnets') 6751 writer.write_end() 6752 6753 @staticmethod 6754 def write_many(objs, writer, singular=None, plural=None): 6755 if singular is None: 6756 singular = 'openstack_network_provider' 6757 if plural is None: 6758 plural = 'openstack_network_providers' 6759 writer.write_start(plural) 6760 if isinstance(objs, List): 6761 href = objs.href 6762 if href is not None: 6763 writer.write_attribute('href', href) 6764 for obj in objs: 6765 OpenStackNetworkProviderWriter.write_one(obj, writer, singular) 6766 writer.write_end() 6767 6768 6769class OpenStackProviderWriter(Writer): 6770 6771 def __init__(self): 6772 super(OpenStackProviderWriter, self).__init__() 6773 6774 @staticmethod 6775 def write_one(obj, writer, singular=None): 6776 if singular is None: 6777 singular = 'open_stack_provider' 6778 writer.write_start(singular) 6779 href = obj.href 6780 if href is not None: 6781 writer.write_attribute('href', href) 6782 if obj.id is not None: 6783 writer.write_attribute('id', obj.id) 6784 if obj.authentication_url is not None: 6785 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6786 if obj.comment is not None: 6787 Writer.write_string(writer, 'comment', obj.comment) 6788 if obj.description is not None: 6789 Writer.write_string(writer, 'description', obj.description) 6790 if obj.name is not None: 6791 Writer.write_string(writer, 'name', obj.name) 6792 if obj.password is not None: 6793 Writer.write_string(writer, 'password', obj.password) 6794 if obj.properties is not None: 6795 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6796 if obj.requires_authentication is not None: 6797 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6798 if obj.tenant_name is not None: 6799 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6800 if obj.url is not None: 6801 Writer.write_string(writer, 'url', obj.url) 6802 if obj.username is not None: 6803 Writer.write_string(writer, 'username', obj.username) 6804 writer.write_end() 6805 6806 @staticmethod 6807 def write_many(objs, writer, singular=None, plural=None): 6808 if singular is None: 6809 singular = 'open_stack_provider' 6810 if plural is None: 6811 plural = 'open_stack_providers' 6812 writer.write_start(plural) 6813 if isinstance(objs, List): 6814 href = objs.href 6815 if href is not None: 6816 writer.write_attribute('href', href) 6817 for obj in objs: 6818 OpenStackProviderWriter.write_one(obj, writer, singular) 6819 writer.write_end() 6820 6821 6822class OpenStackSubnetWriter(Writer): 6823 6824 def __init__(self): 6825 super(OpenStackSubnetWriter, self).__init__() 6826 6827 @staticmethod 6828 def write_one(obj, writer, singular=None): 6829 if singular is None: 6830 singular = 'openstack_subnet' 6831 writer.write_start(singular) 6832 href = obj.href 6833 if href is not None: 6834 writer.write_attribute('href', href) 6835 if obj.id is not None: 6836 writer.write_attribute('id', obj.id) 6837 if obj.cidr is not None: 6838 Writer.write_string(writer, 'cidr', obj.cidr) 6839 if obj.comment is not None: 6840 Writer.write_string(writer, 'comment', obj.comment) 6841 if obj.description is not None: 6842 Writer.write_string(writer, 'description', obj.description) 6843 if obj.dns_servers is not None: 6844 writer.write_start('dns_servers') 6845 for item in obj.dns_servers: 6846 if item is not None: 6847 Writer.write_string(writer, 'dns_server', item) 6848 writer.write_end() 6849 if obj.gateway is not None: 6850 Writer.write_string(writer, 'gateway', obj.gateway) 6851 if obj.ip_version is not None: 6852 Writer.write_string(writer, 'ip_version', obj.ip_version) 6853 if obj.name is not None: 6854 Writer.write_string(writer, 'name', obj.name) 6855 if obj.openstack_network is not None: 6856 OpenStackNetworkWriter.write_one(obj.openstack_network, writer, 'openstack_network') 6857 writer.write_end() 6858 6859 @staticmethod 6860 def write_many(objs, writer, singular=None, plural=None): 6861 if singular is None: 6862 singular = 'openstack_subnet' 6863 if plural is None: 6864 plural = 'openstack_subnets' 6865 writer.write_start(plural) 6866 if isinstance(objs, List): 6867 href = objs.href 6868 if href is not None: 6869 writer.write_attribute('href', href) 6870 for obj in objs: 6871 OpenStackSubnetWriter.write_one(obj, writer, singular) 6872 writer.write_end() 6873 6874 6875class OpenStackVolumeProviderWriter(Writer): 6876 6877 def __init__(self): 6878 super(OpenStackVolumeProviderWriter, self).__init__() 6879 6880 @staticmethod 6881 def write_one(obj, writer, singular=None): 6882 if singular is None: 6883 singular = 'openstack_volume_provider' 6884 writer.write_start(singular) 6885 href = obj.href 6886 if href is not None: 6887 writer.write_attribute('href', href) 6888 if obj.id is not None: 6889 writer.write_attribute('id', obj.id) 6890 if obj.authentication_url is not None: 6891 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6892 if obj.comment is not None: 6893 Writer.write_string(writer, 'comment', obj.comment) 6894 if obj.description is not None: 6895 Writer.write_string(writer, 'description', obj.description) 6896 if obj.name is not None: 6897 Writer.write_string(writer, 'name', obj.name) 6898 if obj.password is not None: 6899 Writer.write_string(writer, 'password', obj.password) 6900 if obj.properties is not None: 6901 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6902 if obj.requires_authentication is not None: 6903 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6904 if obj.tenant_name is not None: 6905 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6906 if obj.url is not None: 6907 Writer.write_string(writer, 'url', obj.url) 6908 if obj.username is not None: 6909 Writer.write_string(writer, 'username', obj.username) 6910 if obj.authentication_keys is not None: 6911 OpenstackVolumeAuthenticationKeyWriter.write_many(obj.authentication_keys, writer, 'openstack_volume_authentication_key', 'authentication_keys') 6912 if obj.certificates is not None: 6913 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6914 if obj.data_center is not None: 6915 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 6916 if obj.volume_types is not None: 6917 OpenStackVolumeTypeWriter.write_many(obj.volume_types, writer, 'open_stack_volume_type', 'volume_types') 6918 writer.write_end() 6919 6920 @staticmethod 6921 def write_many(objs, writer, singular=None, plural=None): 6922 if singular is None: 6923 singular = 'openstack_volume_provider' 6924 if plural is None: 6925 plural = 'openstack_volume_providers' 6926 writer.write_start(plural) 6927 if isinstance(objs, List): 6928 href = objs.href 6929 if href is not None: 6930 writer.write_attribute('href', href) 6931 for obj in objs: 6932 OpenStackVolumeProviderWriter.write_one(obj, writer, singular) 6933 writer.write_end() 6934 6935 6936class OpenStackVolumeTypeWriter(Writer): 6937 6938 def __init__(self): 6939 super(OpenStackVolumeTypeWriter, self).__init__() 6940 6941 @staticmethod 6942 def write_one(obj, writer, singular=None): 6943 if singular is None: 6944 singular = 'open_stack_volume_type' 6945 writer.write_start(singular) 6946 href = obj.href 6947 if href is not None: 6948 writer.write_attribute('href', href) 6949 if obj.id is not None: 6950 writer.write_attribute('id', obj.id) 6951 if obj.comment is not None: 6952 Writer.write_string(writer, 'comment', obj.comment) 6953 if obj.description is not None: 6954 Writer.write_string(writer, 'description', obj.description) 6955 if obj.name is not None: 6956 Writer.write_string(writer, 'name', obj.name) 6957 if obj.properties is not None: 6958 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6959 if obj.openstack_volume_provider is not None: 6960 OpenStackVolumeProviderWriter.write_one(obj.openstack_volume_provider, writer, 'openstack_volume_provider') 6961 writer.write_end() 6962 6963 @staticmethod 6964 def write_many(objs, writer, singular=None, plural=None): 6965 if singular is None: 6966 singular = 'open_stack_volume_type' 6967 if plural is None: 6968 plural = 'open_stack_volume_types' 6969 writer.write_start(plural) 6970 if isinstance(objs, List): 6971 href = objs.href 6972 if href is not None: 6973 writer.write_attribute('href', href) 6974 for obj in objs: 6975 OpenStackVolumeTypeWriter.write_one(obj, writer, singular) 6976 writer.write_end() 6977 6978 6979class OpenstackVolumeAuthenticationKeyWriter(Writer): 6980 6981 def __init__(self): 6982 super(OpenstackVolumeAuthenticationKeyWriter, self).__init__() 6983 6984 @staticmethod 6985 def write_one(obj, writer, singular=None): 6986 if singular is None: 6987 singular = 'openstack_volume_authentication_key' 6988 writer.write_start(singular) 6989 href = obj.href 6990 if href is not None: 6991 writer.write_attribute('href', href) 6992 if obj.id is not None: 6993 writer.write_attribute('id', obj.id) 6994 if obj.comment is not None: 6995 Writer.write_string(writer, 'comment', obj.comment) 6996 if obj.creation_date is not None: 6997 Writer.write_date(writer, 'creation_date', obj.creation_date) 6998 if obj.description is not None: 6999 Writer.write_string(writer, 'description', obj.description) 7000 if obj.name is not None: 7001 Writer.write_string(writer, 'name', obj.name) 7002 if obj.usage_type is not None: 7003 Writer.write_string(writer, 'usage_type', obj.usage_type.value) 7004 if obj.uuid is not None: 7005 Writer.write_string(writer, 'uuid', obj.uuid) 7006 if obj.value is not None: 7007 Writer.write_string(writer, 'value', obj.value) 7008 if obj.openstack_volume_provider is not None: 7009 OpenStackVolumeProviderWriter.write_one(obj.openstack_volume_provider, writer, 'openstack_volume_provider') 7010 writer.write_end() 7011 7012 @staticmethod 7013 def write_many(objs, writer, singular=None, plural=None): 7014 if singular is None: 7015 singular = 'openstack_volume_authentication_key' 7016 if plural is None: 7017 plural = 'openstack_volume_authentication_keys' 7018 writer.write_start(plural) 7019 if isinstance(objs, List): 7020 href = objs.href 7021 if href is not None: 7022 writer.write_attribute('href', href) 7023 for obj in objs: 7024 OpenstackVolumeAuthenticationKeyWriter.write_one(obj, writer, singular) 7025 writer.write_end() 7026 7027 7028class OperatingSystemWriter(Writer): 7029 7030 def __init__(self): 7031 super(OperatingSystemWriter, self).__init__() 7032 7033 @staticmethod 7034 def write_one(obj, writer, singular=None): 7035 if singular is None: 7036 singular = 'os' 7037 writer.write_start(singular) 7038 href = obj.href 7039 if href is not None: 7040 writer.write_attribute('href', href) 7041 if obj.boot is not None: 7042 BootWriter.write_one(obj.boot, writer, 'boot') 7043 if obj.cmdline is not None: 7044 Writer.write_string(writer, 'cmdline', obj.cmdline) 7045 if obj.custom_kernel_cmdline is not None: 7046 Writer.write_string(writer, 'custom_kernel_cmdline', obj.custom_kernel_cmdline) 7047 if obj.description is not None: 7048 Writer.write_string(writer, 'description', obj.description) 7049 if obj.initrd is not None: 7050 Writer.write_string(writer, 'initrd', obj.initrd) 7051 if obj.kernel is not None: 7052 Writer.write_string(writer, 'kernel', obj.kernel) 7053 if obj.reported_kernel_cmdline is not None: 7054 Writer.write_string(writer, 'reported_kernel_cmdline', obj.reported_kernel_cmdline) 7055 if obj.type is not None: 7056 Writer.write_string(writer, 'type', obj.type) 7057 if obj.version is not None: 7058 VersionWriter.write_one(obj.version, writer, 'version') 7059 writer.write_end() 7060 7061 @staticmethod 7062 def write_many(objs, writer, singular=None, plural=None): 7063 if singular is None: 7064 singular = 'os' 7065 if plural is None: 7066 plural = 'oss' 7067 writer.write_start(plural) 7068 if isinstance(objs, List): 7069 href = objs.href 7070 if href is not None: 7071 writer.write_attribute('href', href) 7072 for obj in objs: 7073 OperatingSystemWriter.write_one(obj, writer, singular) 7074 writer.write_end() 7075 7076 7077class OperatingSystemInfoWriter(Writer): 7078 7079 def __init__(self): 7080 super(OperatingSystemInfoWriter, self).__init__() 7081 7082 @staticmethod 7083 def write_one(obj, writer, singular=None): 7084 if singular is None: 7085 singular = 'operating_system' 7086 writer.write_start(singular) 7087 href = obj.href 7088 if href is not None: 7089 writer.write_attribute('href', href) 7090 if obj.id is not None: 7091 writer.write_attribute('id', obj.id) 7092 if obj.architecture is not None: 7093 Writer.write_string(writer, 'architecture', obj.architecture.value) 7094 if obj.comment is not None: 7095 Writer.write_string(writer, 'comment', obj.comment) 7096 if obj.description is not None: 7097 Writer.write_string(writer, 'description', obj.description) 7098 if obj.large_icon is not None: 7099 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 7100 if obj.name is not None: 7101 Writer.write_string(writer, 'name', obj.name) 7102 if obj.small_icon is not None: 7103 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 7104 if obj.tpm_support is not None: 7105 Writer.write_string(writer, 'tpm_support', obj.tpm_support.value) 7106 writer.write_end() 7107 7108 @staticmethod 7109 def write_many(objs, writer, singular=None, plural=None): 7110 if singular is None: 7111 singular = 'operating_system' 7112 if plural is None: 7113 plural = 'operation_systems' 7114 writer.write_start(plural) 7115 if isinstance(objs, List): 7116 href = objs.href 7117 if href is not None: 7118 writer.write_attribute('href', href) 7119 for obj in objs: 7120 OperatingSystemInfoWriter.write_one(obj, writer, singular) 7121 writer.write_end() 7122 7123 7124class OptionWriter(Writer): 7125 7126 def __init__(self): 7127 super(OptionWriter, self).__init__() 7128 7129 @staticmethod 7130 def write_one(obj, writer, singular=None): 7131 if singular is None: 7132 singular = 'option' 7133 writer.write_start(singular) 7134 href = obj.href 7135 if href is not None: 7136 writer.write_attribute('href', href) 7137 if obj.name is not None: 7138 Writer.write_string(writer, 'name', obj.name) 7139 if obj.type is not None: 7140 Writer.write_string(writer, 'type', obj.type) 7141 if obj.value is not None: 7142 Writer.write_string(writer, 'value', obj.value) 7143 writer.write_end() 7144 7145 @staticmethod 7146 def write_many(objs, writer, singular=None, plural=None): 7147 if singular is None: 7148 singular = 'option' 7149 if plural is None: 7150 plural = 'options' 7151 writer.write_start(plural) 7152 if isinstance(objs, List): 7153 href = objs.href 7154 if href is not None: 7155 writer.write_attribute('href', href) 7156 for obj in objs: 7157 OptionWriter.write_one(obj, writer, singular) 7158 writer.write_end() 7159 7160 7161class PackageWriter(Writer): 7162 7163 def __init__(self): 7164 super(PackageWriter, self).__init__() 7165 7166 @staticmethod 7167 def write_one(obj, writer, singular=None): 7168 if singular is None: 7169 singular = 'package' 7170 writer.write_start(singular) 7171 href = obj.href 7172 if href is not None: 7173 writer.write_attribute('href', href) 7174 if obj.name is not None: 7175 Writer.write_string(writer, 'name', obj.name) 7176 writer.write_end() 7177 7178 @staticmethod 7179 def write_many(objs, writer, singular=None, plural=None): 7180 if singular is None: 7181 singular = 'package' 7182 if plural is None: 7183 plural = 'packages' 7184 writer.write_start(plural) 7185 if isinstance(objs, List): 7186 href = objs.href 7187 if href is not None: 7188 writer.write_attribute('href', href) 7189 for obj in objs: 7190 PackageWriter.write_one(obj, writer, singular) 7191 writer.write_end() 7192 7193 7194class PayloadWriter(Writer): 7195 7196 def __init__(self): 7197 super(PayloadWriter, self).__init__() 7198 7199 @staticmethod 7200 def write_one(obj, writer, singular=None): 7201 if singular is None: 7202 singular = 'payload' 7203 writer.write_start(singular) 7204 href = obj.href 7205 if href is not None: 7206 writer.write_attribute('href', href) 7207 if obj.files is not None: 7208 FileWriter.write_many(obj.files, writer, 'file', 'files') 7209 if obj.type is not None: 7210 Writer.write_string(writer, 'type', obj.type.value) 7211 if obj.volume_id is not None: 7212 Writer.write_string(writer, 'volume_id', obj.volume_id) 7213 writer.write_end() 7214 7215 @staticmethod 7216 def write_many(objs, writer, singular=None, plural=None): 7217 if singular is None: 7218 singular = 'payload' 7219 if plural is None: 7220 plural = 'payloads' 7221 writer.write_start(plural) 7222 if isinstance(objs, List): 7223 href = objs.href 7224 if href is not None: 7225 writer.write_attribute('href', href) 7226 for obj in objs: 7227 PayloadWriter.write_one(obj, writer, singular) 7228 writer.write_end() 7229 7230 7231class PermissionWriter(Writer): 7232 7233 def __init__(self): 7234 super(PermissionWriter, self).__init__() 7235 7236 @staticmethod 7237 def write_one(obj, writer, singular=None): 7238 if singular is None: 7239 singular = 'permission' 7240 writer.write_start(singular) 7241 href = obj.href 7242 if href is not None: 7243 writer.write_attribute('href', href) 7244 if obj.id is not None: 7245 writer.write_attribute('id', obj.id) 7246 if obj.comment is not None: 7247 Writer.write_string(writer, 'comment', obj.comment) 7248 if obj.description is not None: 7249 Writer.write_string(writer, 'description', obj.description) 7250 if obj.name is not None: 7251 Writer.write_string(writer, 'name', obj.name) 7252 if obj.cluster is not None: 7253 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 7254 if obj.data_center is not None: 7255 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7256 if obj.disk is not None: 7257 DiskWriter.write_one(obj.disk, writer, 'disk') 7258 if obj.group is not None: 7259 GroupWriter.write_one(obj.group, writer, 'group') 7260 if obj.host is not None: 7261 HostWriter.write_one(obj.host, writer, 'host') 7262 if obj.role is not None: 7263 RoleWriter.write_one(obj.role, writer, 'role') 7264 if obj.storage_domain is not None: 7265 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 7266 if obj.template is not None: 7267 TemplateWriter.write_one(obj.template, writer, 'template') 7268 if obj.user is not None: 7269 UserWriter.write_one(obj.user, writer, 'user') 7270 if obj.vm is not None: 7271 VmWriter.write_one(obj.vm, writer, 'vm') 7272 if obj.vm_pool is not None: 7273 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 7274 writer.write_end() 7275 7276 @staticmethod 7277 def write_many(objs, writer, singular=None, plural=None): 7278 if singular is None: 7279 singular = 'permission' 7280 if plural is None: 7281 plural = 'permissions' 7282 writer.write_start(plural) 7283 if isinstance(objs, List): 7284 href = objs.href 7285 if href is not None: 7286 writer.write_attribute('href', href) 7287 for obj in objs: 7288 PermissionWriter.write_one(obj, writer, singular) 7289 writer.write_end() 7290 7291 7292class PermitWriter(Writer): 7293 7294 def __init__(self): 7295 super(PermitWriter, self).__init__() 7296 7297 @staticmethod 7298 def write_one(obj, writer, singular=None): 7299 if singular is None: 7300 singular = 'permit' 7301 writer.write_start(singular) 7302 href = obj.href 7303 if href is not None: 7304 writer.write_attribute('href', href) 7305 if obj.id is not None: 7306 writer.write_attribute('id', obj.id) 7307 if obj.administrative is not None: 7308 Writer.write_boolean(writer, 'administrative', obj.administrative) 7309 if obj.comment is not None: 7310 Writer.write_string(writer, 'comment', obj.comment) 7311 if obj.description is not None: 7312 Writer.write_string(writer, 'description', obj.description) 7313 if obj.name is not None: 7314 Writer.write_string(writer, 'name', obj.name) 7315 if obj.role is not None: 7316 RoleWriter.write_one(obj.role, writer, 'role') 7317 writer.write_end() 7318 7319 @staticmethod 7320 def write_many(objs, writer, singular=None, plural=None): 7321 if singular is None: 7322 singular = 'permit' 7323 if plural is None: 7324 plural = 'permits' 7325 writer.write_start(plural) 7326 if isinstance(objs, List): 7327 href = objs.href 7328 if href is not None: 7329 writer.write_attribute('href', href) 7330 for obj in objs: 7331 PermitWriter.write_one(obj, writer, singular) 7332 writer.write_end() 7333 7334 7335class PmProxyWriter(Writer): 7336 7337 def __init__(self): 7338 super(PmProxyWriter, self).__init__() 7339 7340 @staticmethod 7341 def write_one(obj, writer, singular=None): 7342 if singular is None: 7343 singular = 'pm_proxy' 7344 writer.write_start(singular) 7345 href = obj.href 7346 if href is not None: 7347 writer.write_attribute('href', href) 7348 if obj.type is not None: 7349 Writer.write_string(writer, 'type', obj.type.value) 7350 writer.write_end() 7351 7352 @staticmethod 7353 def write_many(objs, writer, singular=None, plural=None): 7354 if singular is None: 7355 singular = 'pm_proxy' 7356 if plural is None: 7357 plural = 'pm_proxies' 7358 writer.write_start(plural) 7359 if isinstance(objs, List): 7360 href = objs.href 7361 if href is not None: 7362 writer.write_attribute('href', href) 7363 for obj in objs: 7364 PmProxyWriter.write_one(obj, writer, singular) 7365 writer.write_end() 7366 7367 7368class PortMirroringWriter(Writer): 7369 7370 def __init__(self): 7371 super(PortMirroringWriter, self).__init__() 7372 7373 @staticmethod 7374 def write_one(obj, writer, singular=None): 7375 if singular is None: 7376 singular = 'port_mirroring' 7377 writer.write_start(singular) 7378 href = obj.href 7379 if href is not None: 7380 writer.write_attribute('href', href) 7381 writer.write_end() 7382 7383 @staticmethod 7384 def write_many(objs, writer, singular=None, plural=None): 7385 if singular is None: 7386 singular = 'port_mirroring' 7387 if plural is None: 7388 plural = 'port_mirrorings' 7389 writer.write_start(plural) 7390 if isinstance(objs, List): 7391 href = objs.href 7392 if href is not None: 7393 writer.write_attribute('href', href) 7394 for obj in objs: 7395 PortMirroringWriter.write_one(obj, writer, singular) 7396 writer.write_end() 7397 7398 7399class PowerManagementWriter(Writer): 7400 7401 def __init__(self): 7402 super(PowerManagementWriter, self).__init__() 7403 7404 @staticmethod 7405 def write_one(obj, writer, singular=None): 7406 if singular is None: 7407 singular = 'power_management' 7408 writer.write_start(singular) 7409 href = obj.href 7410 if href is not None: 7411 writer.write_attribute('href', href) 7412 if obj.address is not None: 7413 Writer.write_string(writer, 'address', obj.address) 7414 if obj.agents is not None: 7415 AgentWriter.write_many(obj.agents, writer, 'agent', 'agents') 7416 if obj.automatic_pm_enabled is not None: 7417 Writer.write_boolean(writer, 'automatic_pm_enabled', obj.automatic_pm_enabled) 7418 if obj.enabled is not None: 7419 Writer.write_boolean(writer, 'enabled', obj.enabled) 7420 if obj.kdump_detection is not None: 7421 Writer.write_boolean(writer, 'kdump_detection', obj.kdump_detection) 7422 if obj.options is not None: 7423 OptionWriter.write_many(obj.options, writer, 'option', 'options') 7424 if obj.password is not None: 7425 Writer.write_string(writer, 'password', obj.password) 7426 if obj.pm_proxies is not None: 7427 PmProxyWriter.write_many(obj.pm_proxies, writer, 'pm_proxy', 'pm_proxies') 7428 if obj.status is not None: 7429 Writer.write_string(writer, 'status', obj.status.value) 7430 if obj.type is not None: 7431 Writer.write_string(writer, 'type', obj.type) 7432 if obj.username is not None: 7433 Writer.write_string(writer, 'username', obj.username) 7434 writer.write_end() 7435 7436 @staticmethod 7437 def write_many(objs, writer, singular=None, plural=None): 7438 if singular is None: 7439 singular = 'power_management' 7440 if plural is None: 7441 plural = 'power_managements' 7442 writer.write_start(plural) 7443 if isinstance(objs, List): 7444 href = objs.href 7445 if href is not None: 7446 writer.write_attribute('href', href) 7447 for obj in objs: 7448 PowerManagementWriter.write_one(obj, writer, singular) 7449 writer.write_end() 7450 7451 7452class ProductWriter(Writer): 7453 7454 def __init__(self): 7455 super(ProductWriter, self).__init__() 7456 7457 @staticmethod 7458 def write_one(obj, writer, singular=None): 7459 if singular is None: 7460 singular = 'product' 7461 writer.write_start(singular) 7462 href = obj.href 7463 if href is not None: 7464 writer.write_attribute('href', href) 7465 if obj.id is not None: 7466 writer.write_attribute('id', obj.id) 7467 if obj.comment is not None: 7468 Writer.write_string(writer, 'comment', obj.comment) 7469 if obj.description is not None: 7470 Writer.write_string(writer, 'description', obj.description) 7471 if obj.name is not None: 7472 Writer.write_string(writer, 'name', obj.name) 7473 writer.write_end() 7474 7475 @staticmethod 7476 def write_many(objs, writer, singular=None, plural=None): 7477 if singular is None: 7478 singular = 'product' 7479 if plural is None: 7480 plural = 'products' 7481 writer.write_start(plural) 7482 if isinstance(objs, List): 7483 href = objs.href 7484 if href is not None: 7485 writer.write_attribute('href', href) 7486 for obj in objs: 7487 ProductWriter.write_one(obj, writer, singular) 7488 writer.write_end() 7489 7490 7491class ProductInfoWriter(Writer): 7492 7493 def __init__(self): 7494 super(ProductInfoWriter, self).__init__() 7495 7496 @staticmethod 7497 def write_one(obj, writer, singular=None): 7498 if singular is None: 7499 singular = 'product_info' 7500 writer.write_start(singular) 7501 href = obj.href 7502 if href is not None: 7503 writer.write_attribute('href', href) 7504 if obj.instance_id is not None: 7505 Writer.write_string(writer, 'instance_id', obj.instance_id) 7506 if obj.name is not None: 7507 Writer.write_string(writer, 'name', obj.name) 7508 if obj.vendor is not None: 7509 Writer.write_string(writer, 'vendor', obj.vendor) 7510 if obj.version is not None: 7511 VersionWriter.write_one(obj.version, writer, 'version') 7512 writer.write_end() 7513 7514 @staticmethod 7515 def write_many(objs, writer, singular=None, plural=None): 7516 if singular is None: 7517 singular = 'product_info' 7518 if plural is None: 7519 plural = 'product_infos' 7520 writer.write_start(plural) 7521 if isinstance(objs, List): 7522 href = objs.href 7523 if href is not None: 7524 writer.write_attribute('href', href) 7525 for obj in objs: 7526 ProductInfoWriter.write_one(obj, writer, singular) 7527 writer.write_end() 7528 7529 7530class ProfileDetailWriter(Writer): 7531 7532 def __init__(self): 7533 super(ProfileDetailWriter, self).__init__() 7534 7535 @staticmethod 7536 def write_one(obj, writer, singular=None): 7537 if singular is None: 7538 singular = 'profile_detail' 7539 writer.write_start(singular) 7540 href = obj.href 7541 if href is not None: 7542 writer.write_attribute('href', href) 7543 if obj.block_statistics is not None: 7544 BlockStatisticWriter.write_many(obj.block_statistics, writer, 'block_statistic', 'block_statistics') 7545 if obj.duration is not None: 7546 Writer.write_integer(writer, 'duration', obj.duration) 7547 if obj.fop_statistics is not None: 7548 FopStatisticWriter.write_many(obj.fop_statistics, writer, 'fop_statistic', 'fop_statistics') 7549 if obj.profile_type is not None: 7550 Writer.write_string(writer, 'profile_type', obj.profile_type) 7551 if obj.statistics is not None: 7552 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 7553 writer.write_end() 7554 7555 @staticmethod 7556 def write_many(objs, writer, singular=None, plural=None): 7557 if singular is None: 7558 singular = 'profile_detail' 7559 if plural is None: 7560 plural = 'profile_details' 7561 writer.write_start(plural) 7562 if isinstance(objs, List): 7563 href = objs.href 7564 if href is not None: 7565 writer.write_attribute('href', href) 7566 for obj in objs: 7567 ProfileDetailWriter.write_one(obj, writer, singular) 7568 writer.write_end() 7569 7570 7571class PropertyWriter(Writer): 7572 7573 def __init__(self): 7574 super(PropertyWriter, self).__init__() 7575 7576 @staticmethod 7577 def write_one(obj, writer, singular=None): 7578 if singular is None: 7579 singular = 'property' 7580 writer.write_start(singular) 7581 href = obj.href 7582 if href is not None: 7583 writer.write_attribute('href', href) 7584 if obj.name is not None: 7585 Writer.write_string(writer, 'name', obj.name) 7586 if obj.value is not None: 7587 Writer.write_string(writer, 'value', obj.value) 7588 writer.write_end() 7589 7590 @staticmethod 7591 def write_many(objs, writer, singular=None, plural=None): 7592 if singular is None: 7593 singular = 'property' 7594 if plural is None: 7595 plural = 'properties' 7596 writer.write_start(plural) 7597 if isinstance(objs, List): 7598 href = objs.href 7599 if href is not None: 7600 writer.write_attribute('href', href) 7601 for obj in objs: 7602 PropertyWriter.write_one(obj, writer, singular) 7603 writer.write_end() 7604 7605 7606class ProxyTicketWriter(Writer): 7607 7608 def __init__(self): 7609 super(ProxyTicketWriter, self).__init__() 7610 7611 @staticmethod 7612 def write_one(obj, writer, singular=None): 7613 if singular is None: 7614 singular = 'proxy_ticket' 7615 writer.write_start(singular) 7616 href = obj.href 7617 if href is not None: 7618 writer.write_attribute('href', href) 7619 if obj.value is not None: 7620 Writer.write_string(writer, 'value', obj.value) 7621 writer.write_end() 7622 7623 @staticmethod 7624 def write_many(objs, writer, singular=None, plural=None): 7625 if singular is None: 7626 singular = 'proxy_ticket' 7627 if plural is None: 7628 plural = 'proxy_tickets' 7629 writer.write_start(plural) 7630 if isinstance(objs, List): 7631 href = objs.href 7632 if href is not None: 7633 writer.write_attribute('href', href) 7634 for obj in objs: 7635 ProxyTicketWriter.write_one(obj, writer, singular) 7636 writer.write_end() 7637 7638 7639class QosWriter(Writer): 7640 7641 def __init__(self): 7642 super(QosWriter, self).__init__() 7643 7644 @staticmethod 7645 def write_one(obj, writer, singular=None): 7646 if singular is None: 7647 singular = 'qos' 7648 writer.write_start(singular) 7649 href = obj.href 7650 if href is not None: 7651 writer.write_attribute('href', href) 7652 if obj.id is not None: 7653 writer.write_attribute('id', obj.id) 7654 if obj.comment is not None: 7655 Writer.write_string(writer, 'comment', obj.comment) 7656 if obj.cpu_limit is not None: 7657 Writer.write_integer(writer, 'cpu_limit', obj.cpu_limit) 7658 if obj.description is not None: 7659 Writer.write_string(writer, 'description', obj.description) 7660 if obj.inbound_average is not None: 7661 Writer.write_integer(writer, 'inbound_average', obj.inbound_average) 7662 if obj.inbound_burst is not None: 7663 Writer.write_integer(writer, 'inbound_burst', obj.inbound_burst) 7664 if obj.inbound_peak is not None: 7665 Writer.write_integer(writer, 'inbound_peak', obj.inbound_peak) 7666 if obj.max_iops is not None: 7667 Writer.write_integer(writer, 'max_iops', obj.max_iops) 7668 if obj.max_read_iops is not None: 7669 Writer.write_integer(writer, 'max_read_iops', obj.max_read_iops) 7670 if obj.max_read_throughput is not None: 7671 Writer.write_integer(writer, 'max_read_throughput', obj.max_read_throughput) 7672 if obj.max_throughput is not None: 7673 Writer.write_integer(writer, 'max_throughput', obj.max_throughput) 7674 if obj.max_write_iops is not None: 7675 Writer.write_integer(writer, 'max_write_iops', obj.max_write_iops) 7676 if obj.max_write_throughput is not None: 7677 Writer.write_integer(writer, 'max_write_throughput', obj.max_write_throughput) 7678 if obj.name is not None: 7679 Writer.write_string(writer, 'name', obj.name) 7680 if obj.outbound_average is not None: 7681 Writer.write_integer(writer, 'outbound_average', obj.outbound_average) 7682 if obj.outbound_average_linkshare is not None: 7683 Writer.write_integer(writer, 'outbound_average_linkshare', obj.outbound_average_linkshare) 7684 if obj.outbound_average_realtime is not None: 7685 Writer.write_integer(writer, 'outbound_average_realtime', obj.outbound_average_realtime) 7686 if obj.outbound_average_upperlimit is not None: 7687 Writer.write_integer(writer, 'outbound_average_upperlimit', obj.outbound_average_upperlimit) 7688 if obj.outbound_burst is not None: 7689 Writer.write_integer(writer, 'outbound_burst', obj.outbound_burst) 7690 if obj.outbound_peak is not None: 7691 Writer.write_integer(writer, 'outbound_peak', obj.outbound_peak) 7692 if obj.type is not None: 7693 Writer.write_string(writer, 'type', obj.type.value) 7694 if obj.data_center is not None: 7695 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7696 writer.write_end() 7697 7698 @staticmethod 7699 def write_many(objs, writer, singular=None, plural=None): 7700 if singular is None: 7701 singular = 'qos' 7702 if plural is None: 7703 plural = 'qoss' 7704 writer.write_start(plural) 7705 if isinstance(objs, List): 7706 href = objs.href 7707 if href is not None: 7708 writer.write_attribute('href', href) 7709 for obj in objs: 7710 QosWriter.write_one(obj, writer, singular) 7711 writer.write_end() 7712 7713 7714class QuotaWriter(Writer): 7715 7716 def __init__(self): 7717 super(QuotaWriter, self).__init__() 7718 7719 @staticmethod 7720 def write_one(obj, writer, singular=None): 7721 if singular is None: 7722 singular = 'quota' 7723 writer.write_start(singular) 7724 href = obj.href 7725 if href is not None: 7726 writer.write_attribute('href', href) 7727 if obj.id is not None: 7728 writer.write_attribute('id', obj.id) 7729 if obj.cluster_hard_limit_pct is not None: 7730 Writer.write_integer(writer, 'cluster_hard_limit_pct', obj.cluster_hard_limit_pct) 7731 if obj.cluster_soft_limit_pct is not None: 7732 Writer.write_integer(writer, 'cluster_soft_limit_pct', obj.cluster_soft_limit_pct) 7733 if obj.comment is not None: 7734 Writer.write_string(writer, 'comment', obj.comment) 7735 if obj.data_center is not None: 7736 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7737 if obj.description is not None: 7738 Writer.write_string(writer, 'description', obj.description) 7739 if obj.disks is not None: 7740 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 7741 if obj.name is not None: 7742 Writer.write_string(writer, 'name', obj.name) 7743 if obj.storage_hard_limit_pct is not None: 7744 Writer.write_integer(writer, 'storage_hard_limit_pct', obj.storage_hard_limit_pct) 7745 if obj.storage_soft_limit_pct is not None: 7746 Writer.write_integer(writer, 'storage_soft_limit_pct', obj.storage_soft_limit_pct) 7747 if obj.users is not None: 7748 UserWriter.write_many(obj.users, writer, 'user', 'users') 7749 if obj.vms is not None: 7750 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 7751 if obj.permissions is not None: 7752 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 7753 if obj.quota_cluster_limits is not None: 7754 QuotaClusterLimitWriter.write_many(obj.quota_cluster_limits, writer, 'quota_cluster_limit', 'quota_cluster_limits') 7755 if obj.quota_storage_limits is not None: 7756 QuotaStorageLimitWriter.write_many(obj.quota_storage_limits, writer, 'quota_storage_limit', 'quota_storage_limits') 7757 writer.write_end() 7758 7759 @staticmethod 7760 def write_many(objs, writer, singular=None, plural=None): 7761 if singular is None: 7762 singular = 'quota' 7763 if plural is None: 7764 plural = 'quotas' 7765 writer.write_start(plural) 7766 if isinstance(objs, List): 7767 href = objs.href 7768 if href is not None: 7769 writer.write_attribute('href', href) 7770 for obj in objs: 7771 QuotaWriter.write_one(obj, writer, singular) 7772 writer.write_end() 7773 7774 7775class QuotaClusterLimitWriter(Writer): 7776 7777 def __init__(self): 7778 super(QuotaClusterLimitWriter, self).__init__() 7779 7780 @staticmethod 7781 def write_one(obj, writer, singular=None): 7782 if singular is None: 7783 singular = 'quota_cluster_limit' 7784 writer.write_start(singular) 7785 href = obj.href 7786 if href is not None: 7787 writer.write_attribute('href', href) 7788 if obj.id is not None: 7789 writer.write_attribute('id', obj.id) 7790 if obj.comment is not None: 7791 Writer.write_string(writer, 'comment', obj.comment) 7792 if obj.description is not None: 7793 Writer.write_string(writer, 'description', obj.description) 7794 if obj.memory_limit is not None: 7795 Writer.write_decimal(writer, 'memory_limit', obj.memory_limit) 7796 if obj.memory_usage is not None: 7797 Writer.write_decimal(writer, 'memory_usage', obj.memory_usage) 7798 if obj.name is not None: 7799 Writer.write_string(writer, 'name', obj.name) 7800 if obj.vcpu_limit is not None: 7801 Writer.write_integer(writer, 'vcpu_limit', obj.vcpu_limit) 7802 if obj.vcpu_usage is not None: 7803 Writer.write_integer(writer, 'vcpu_usage', obj.vcpu_usage) 7804 if obj.cluster is not None: 7805 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 7806 if obj.quota is not None: 7807 QuotaWriter.write_one(obj.quota, writer, 'quota') 7808 writer.write_end() 7809 7810 @staticmethod 7811 def write_many(objs, writer, singular=None, plural=None): 7812 if singular is None: 7813 singular = 'quota_cluster_limit' 7814 if plural is None: 7815 plural = 'quota_cluster_limits' 7816 writer.write_start(plural) 7817 if isinstance(objs, List): 7818 href = objs.href 7819 if href is not None: 7820 writer.write_attribute('href', href) 7821 for obj in objs: 7822 QuotaClusterLimitWriter.write_one(obj, writer, singular) 7823 writer.write_end() 7824 7825 7826class QuotaStorageLimitWriter(Writer): 7827 7828 def __init__(self): 7829 super(QuotaStorageLimitWriter, self).__init__() 7830 7831 @staticmethod 7832 def write_one(obj, writer, singular=None): 7833 if singular is None: 7834 singular = 'quota_storage_limit' 7835 writer.write_start(singular) 7836 href = obj.href 7837 if href is not None: 7838 writer.write_attribute('href', href) 7839 if obj.id is not None: 7840 writer.write_attribute('id', obj.id) 7841 if obj.comment is not None: 7842 Writer.write_string(writer, 'comment', obj.comment) 7843 if obj.description is not None: 7844 Writer.write_string(writer, 'description', obj.description) 7845 if obj.limit is not None: 7846 Writer.write_integer(writer, 'limit', obj.limit) 7847 if obj.name is not None: 7848 Writer.write_string(writer, 'name', obj.name) 7849 if obj.usage is not None: 7850 Writer.write_decimal(writer, 'usage', obj.usage) 7851 if obj.quota is not None: 7852 QuotaWriter.write_one(obj.quota, writer, 'quota') 7853 if obj.storage_domain is not None: 7854 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 7855 writer.write_end() 7856 7857 @staticmethod 7858 def write_many(objs, writer, singular=None, plural=None): 7859 if singular is None: 7860 singular = 'quota_storage_limit' 7861 if plural is None: 7862 plural = 'quota_storage_limits' 7863 writer.write_start(plural) 7864 if isinstance(objs, List): 7865 href = objs.href 7866 if href is not None: 7867 writer.write_attribute('href', href) 7868 for obj in objs: 7869 QuotaStorageLimitWriter.write_one(obj, writer, singular) 7870 writer.write_end() 7871 7872 7873class RangeWriter(Writer): 7874 7875 def __init__(self): 7876 super(RangeWriter, self).__init__() 7877 7878 @staticmethod 7879 def write_one(obj, writer, singular=None): 7880 if singular is None: 7881 singular = 'range' 7882 writer.write_start(singular) 7883 href = obj.href 7884 if href is not None: 7885 writer.write_attribute('href', href) 7886 if obj.from_ is not None: 7887 Writer.write_string(writer, 'from', obj.from_) 7888 if obj.to is not None: 7889 Writer.write_string(writer, 'to', obj.to) 7890 writer.write_end() 7891 7892 @staticmethod 7893 def write_many(objs, writer, singular=None, plural=None): 7894 if singular is None: 7895 singular = 'range' 7896 if plural is None: 7897 plural = 'ranges' 7898 writer.write_start(plural) 7899 if isinstance(objs, List): 7900 href = objs.href 7901 if href is not None: 7902 writer.write_attribute('href', href) 7903 for obj in objs: 7904 RangeWriter.write_one(obj, writer, singular) 7905 writer.write_end() 7906 7907 7908class RateWriter(Writer): 7909 7910 def __init__(self): 7911 super(RateWriter, self).__init__() 7912 7913 @staticmethod 7914 def write_one(obj, writer, singular=None): 7915 if singular is None: 7916 singular = 'rate' 7917 writer.write_start(singular) 7918 href = obj.href 7919 if href is not None: 7920 writer.write_attribute('href', href) 7921 if obj.bytes is not None: 7922 Writer.write_integer(writer, 'bytes', obj.bytes) 7923 if obj.period is not None: 7924 Writer.write_integer(writer, 'period', obj.period) 7925 writer.write_end() 7926 7927 @staticmethod 7928 def write_many(objs, writer, singular=None, plural=None): 7929 if singular is None: 7930 singular = 'rate' 7931 if plural is None: 7932 plural = 'rates' 7933 writer.write_start(plural) 7934 if isinstance(objs, List): 7935 href = objs.href 7936 if href is not None: 7937 writer.write_attribute('href', href) 7938 for obj in objs: 7939 RateWriter.write_one(obj, writer, singular) 7940 writer.write_end() 7941 7942 7943class RegistrationAffinityGroupMappingWriter(Writer): 7944 7945 def __init__(self): 7946 super(RegistrationAffinityGroupMappingWriter, self).__init__() 7947 7948 @staticmethod 7949 def write_one(obj, writer, singular=None): 7950 if singular is None: 7951 singular = 'registration_affinity_group_mapping' 7952 writer.write_start(singular) 7953 href = obj.href 7954 if href is not None: 7955 writer.write_attribute('href', href) 7956 if obj.from_ is not None: 7957 AffinityGroupWriter.write_one(obj.from_, writer, 'from') 7958 if obj.to is not None: 7959 AffinityGroupWriter.write_one(obj.to, writer, 'to') 7960 writer.write_end() 7961 7962 @staticmethod 7963 def write_many(objs, writer, singular=None, plural=None): 7964 if singular is None: 7965 singular = 'registration_affinity_group_mapping' 7966 if plural is None: 7967 plural = 'registration_affinity_group_mappings' 7968 writer.write_start(plural) 7969 if isinstance(objs, List): 7970 href = objs.href 7971 if href is not None: 7972 writer.write_attribute('href', href) 7973 for obj in objs: 7974 RegistrationAffinityGroupMappingWriter.write_one(obj, writer, singular) 7975 writer.write_end() 7976 7977 7978class RegistrationAffinityLabelMappingWriter(Writer): 7979 7980 def __init__(self): 7981 super(RegistrationAffinityLabelMappingWriter, self).__init__() 7982 7983 @staticmethod 7984 def write_one(obj, writer, singular=None): 7985 if singular is None: 7986 singular = 'registration_affinity_label_mapping' 7987 writer.write_start(singular) 7988 href = obj.href 7989 if href is not None: 7990 writer.write_attribute('href', href) 7991 if obj.from_ is not None: 7992 AffinityLabelWriter.write_one(obj.from_, writer, 'from') 7993 if obj.to is not None: 7994 AffinityLabelWriter.write_one(obj.to, writer, 'to') 7995 writer.write_end() 7996 7997 @staticmethod 7998 def write_many(objs, writer, singular=None, plural=None): 7999 if singular is None: 8000 singular = 'registration_affinity_label_mapping' 8001 if plural is None: 8002 plural = 'registration_affinity_label_mappings' 8003 writer.write_start(plural) 8004 if isinstance(objs, List): 8005 href = objs.href 8006 if href is not None: 8007 writer.write_attribute('href', href) 8008 for obj in objs: 8009 RegistrationAffinityLabelMappingWriter.write_one(obj, writer, singular) 8010 writer.write_end() 8011 8012 8013class RegistrationClusterMappingWriter(Writer): 8014 8015 def __init__(self): 8016 super(RegistrationClusterMappingWriter, self).__init__() 8017 8018 @staticmethod 8019 def write_one(obj, writer, singular=None): 8020 if singular is None: 8021 singular = 'registration_cluster_mapping' 8022 writer.write_start(singular) 8023 href = obj.href 8024 if href is not None: 8025 writer.write_attribute('href', href) 8026 if obj.from_ is not None: 8027 ClusterWriter.write_one(obj.from_, writer, 'from') 8028 if obj.to is not None: 8029 ClusterWriter.write_one(obj.to, writer, 'to') 8030 writer.write_end() 8031 8032 @staticmethod 8033 def write_many(objs, writer, singular=None, plural=None): 8034 if singular is None: 8035 singular = 'registration_cluster_mapping' 8036 if plural is None: 8037 plural = 'registration_cluster_mappings' 8038 writer.write_start(plural) 8039 if isinstance(objs, List): 8040 href = objs.href 8041 if href is not None: 8042 writer.write_attribute('href', href) 8043 for obj in objs: 8044 RegistrationClusterMappingWriter.write_one(obj, writer, singular) 8045 writer.write_end() 8046 8047 8048class RegistrationConfigurationWriter(Writer): 8049 8050 def __init__(self): 8051 super(RegistrationConfigurationWriter, self).__init__() 8052 8053 @staticmethod 8054 def write_one(obj, writer, singular=None): 8055 if singular is None: 8056 singular = 'registration_configuration' 8057 writer.write_start(singular) 8058 href = obj.href 8059 if href is not None: 8060 writer.write_attribute('href', href) 8061 if obj.affinity_group_mappings is not None: 8062 RegistrationAffinityGroupMappingWriter.write_many(obj.affinity_group_mappings, writer, 'registration_affinity_group_mapping', 'affinity_group_mappings') 8063 if obj.affinity_label_mappings is not None: 8064 RegistrationAffinityLabelMappingWriter.write_many(obj.affinity_label_mappings, writer, 'registration_affinity_label_mapping', 'affinity_label_mappings') 8065 if obj.cluster_mappings is not None: 8066 RegistrationClusterMappingWriter.write_many(obj.cluster_mappings, writer, 'registration_cluster_mapping', 'cluster_mappings') 8067 if obj.domain_mappings is not None: 8068 RegistrationDomainMappingWriter.write_many(obj.domain_mappings, writer, 'registration_domain_mapping', 'domain_mappings') 8069 if obj.lun_mappings is not None: 8070 RegistrationLunMappingWriter.write_many(obj.lun_mappings, writer, 'registration_lun_mapping', 'lun_mappings') 8071 if obj.role_mappings is not None: 8072 RegistrationRoleMappingWriter.write_many(obj.role_mappings, writer, 'registration_role_mapping', 'role_mappings') 8073 if obj.vnic_profile_mappings is not None: 8074 RegistrationVnicProfileMappingWriter.write_many(obj.vnic_profile_mappings, writer, 'registration_vnic_profile_mapping', 'vnic_profile_mappings') 8075 writer.write_end() 8076 8077 @staticmethod 8078 def write_many(objs, writer, singular=None, plural=None): 8079 if singular is None: 8080 singular = 'registration_configuration' 8081 if plural is None: 8082 plural = 'registration_configurations' 8083 writer.write_start(plural) 8084 if isinstance(objs, List): 8085 href = objs.href 8086 if href is not None: 8087 writer.write_attribute('href', href) 8088 for obj in objs: 8089 RegistrationConfigurationWriter.write_one(obj, writer, singular) 8090 writer.write_end() 8091 8092 8093class RegistrationDomainMappingWriter(Writer): 8094 8095 def __init__(self): 8096 super(RegistrationDomainMappingWriter, self).__init__() 8097 8098 @staticmethod 8099 def write_one(obj, writer, singular=None): 8100 if singular is None: 8101 singular = 'registration_domain_mapping' 8102 writer.write_start(singular) 8103 href = obj.href 8104 if href is not None: 8105 writer.write_attribute('href', href) 8106 if obj.from_ is not None: 8107 DomainWriter.write_one(obj.from_, writer, 'from') 8108 if obj.to is not None: 8109 DomainWriter.write_one(obj.to, writer, 'to') 8110 writer.write_end() 8111 8112 @staticmethod 8113 def write_many(objs, writer, singular=None, plural=None): 8114 if singular is None: 8115 singular = 'registration_domain_mapping' 8116 if plural is None: 8117 plural = 'registration_domain_mappings' 8118 writer.write_start(plural) 8119 if isinstance(objs, List): 8120 href = objs.href 8121 if href is not None: 8122 writer.write_attribute('href', href) 8123 for obj in objs: 8124 RegistrationDomainMappingWriter.write_one(obj, writer, singular) 8125 writer.write_end() 8126 8127 8128class RegistrationLunMappingWriter(Writer): 8129 8130 def __init__(self): 8131 super(RegistrationLunMappingWriter, self).__init__() 8132 8133 @staticmethod 8134 def write_one(obj, writer, singular=None): 8135 if singular is None: 8136 singular = 'registration_lun_mapping' 8137 writer.write_start(singular) 8138 href = obj.href 8139 if href is not None: 8140 writer.write_attribute('href', href) 8141 if obj.from_ is not None: 8142 DiskWriter.write_one(obj.from_, writer, 'from') 8143 if obj.to is not None: 8144 DiskWriter.write_one(obj.to, writer, 'to') 8145 writer.write_end() 8146 8147 @staticmethod 8148 def write_many(objs, writer, singular=None, plural=None): 8149 if singular is None: 8150 singular = 'registration_lun_mapping' 8151 if plural is None: 8152 plural = 'registration_lun_mappings' 8153 writer.write_start(plural) 8154 if isinstance(objs, List): 8155 href = objs.href 8156 if href is not None: 8157 writer.write_attribute('href', href) 8158 for obj in objs: 8159 RegistrationLunMappingWriter.write_one(obj, writer, singular) 8160 writer.write_end() 8161 8162 8163class RegistrationRoleMappingWriter(Writer): 8164 8165 def __init__(self): 8166 super(RegistrationRoleMappingWriter, self).__init__() 8167 8168 @staticmethod 8169 def write_one(obj, writer, singular=None): 8170 if singular is None: 8171 singular = 'registration_role_mapping' 8172 writer.write_start(singular) 8173 href = obj.href 8174 if href is not None: 8175 writer.write_attribute('href', href) 8176 if obj.from_ is not None: 8177 RoleWriter.write_one(obj.from_, writer, 'from') 8178 if obj.to is not None: 8179 RoleWriter.write_one(obj.to, writer, 'to') 8180 writer.write_end() 8181 8182 @staticmethod 8183 def write_many(objs, writer, singular=None, plural=None): 8184 if singular is None: 8185 singular = 'registration_role_mapping' 8186 if plural is None: 8187 plural = 'registration_role_mappings' 8188 writer.write_start(plural) 8189 if isinstance(objs, List): 8190 href = objs.href 8191 if href is not None: 8192 writer.write_attribute('href', href) 8193 for obj in objs: 8194 RegistrationRoleMappingWriter.write_one(obj, writer, singular) 8195 writer.write_end() 8196 8197 8198class RegistrationVnicProfileMappingWriter(Writer): 8199 8200 def __init__(self): 8201 super(RegistrationVnicProfileMappingWriter, self).__init__() 8202 8203 @staticmethod 8204 def write_one(obj, writer, singular=None): 8205 if singular is None: 8206 singular = 'registration_vnic_profile_mapping' 8207 writer.write_start(singular) 8208 href = obj.href 8209 if href is not None: 8210 writer.write_attribute('href', href) 8211 if obj.from_ is not None: 8212 VnicProfileWriter.write_one(obj.from_, writer, 'from') 8213 if obj.to is not None: 8214 VnicProfileWriter.write_one(obj.to, writer, 'to') 8215 writer.write_end() 8216 8217 @staticmethod 8218 def write_many(objs, writer, singular=None, plural=None): 8219 if singular is None: 8220 singular = 'registration_vnic_profile_mapping' 8221 if plural is None: 8222 plural = 'registration_vnic_profile_mappings' 8223 writer.write_start(plural) 8224 if isinstance(objs, List): 8225 href = objs.href 8226 if href is not None: 8227 writer.write_attribute('href', href) 8228 for obj in objs: 8229 RegistrationVnicProfileMappingWriter.write_one(obj, writer, singular) 8230 writer.write_end() 8231 8232 8233class ReportedConfigurationWriter(Writer): 8234 8235 def __init__(self): 8236 super(ReportedConfigurationWriter, self).__init__() 8237 8238 @staticmethod 8239 def write_one(obj, writer, singular=None): 8240 if singular is None: 8241 singular = 'reported_configuration' 8242 writer.write_start(singular) 8243 href = obj.href 8244 if href is not None: 8245 writer.write_attribute('href', href) 8246 if obj.actual_value is not None: 8247 Writer.write_string(writer, 'actual_value', obj.actual_value) 8248 if obj.expected_value is not None: 8249 Writer.write_string(writer, 'expected_value', obj.expected_value) 8250 if obj.in_sync is not None: 8251 Writer.write_boolean(writer, 'in_sync', obj.in_sync) 8252 if obj.name is not None: 8253 Writer.write_string(writer, 'name', obj.name) 8254 writer.write_end() 8255 8256 @staticmethod 8257 def write_many(objs, writer, singular=None, plural=None): 8258 if singular is None: 8259 singular = 'reported_configuration' 8260 if plural is None: 8261 plural = 'reported_configurations' 8262 writer.write_start(plural) 8263 if isinstance(objs, List): 8264 href = objs.href 8265 if href is not None: 8266 writer.write_attribute('href', href) 8267 for obj in objs: 8268 ReportedConfigurationWriter.write_one(obj, writer, singular) 8269 writer.write_end() 8270 8271 8272class ReportedDeviceWriter(Writer): 8273 8274 def __init__(self): 8275 super(ReportedDeviceWriter, self).__init__() 8276 8277 @staticmethod 8278 def write_one(obj, writer, singular=None): 8279 if singular is None: 8280 singular = 'reported_device' 8281 writer.write_start(singular) 8282 href = obj.href 8283 if href is not None: 8284 writer.write_attribute('href', href) 8285 if obj.id is not None: 8286 writer.write_attribute('id', obj.id) 8287 if obj.comment is not None: 8288 Writer.write_string(writer, 'comment', obj.comment) 8289 if obj.description is not None: 8290 Writer.write_string(writer, 'description', obj.description) 8291 if obj.ips is not None: 8292 IpWriter.write_many(obj.ips, writer, 'ip', 'ips') 8293 if obj.mac is not None: 8294 MacWriter.write_one(obj.mac, writer, 'mac') 8295 if obj.name is not None: 8296 Writer.write_string(writer, 'name', obj.name) 8297 if obj.type is not None: 8298 Writer.write_string(writer, 'type', obj.type.value) 8299 if obj.vm is not None: 8300 VmWriter.write_one(obj.vm, writer, 'vm') 8301 writer.write_end() 8302 8303 @staticmethod 8304 def write_many(objs, writer, singular=None, plural=None): 8305 if singular is None: 8306 singular = 'reported_device' 8307 if plural is None: 8308 plural = 'reported_devices' 8309 writer.write_start(plural) 8310 if isinstance(objs, List): 8311 href = objs.href 8312 if href is not None: 8313 writer.write_attribute('href', href) 8314 for obj in objs: 8315 ReportedDeviceWriter.write_one(obj, writer, singular) 8316 writer.write_end() 8317 8318 8319class RngDeviceWriter(Writer): 8320 8321 def __init__(self): 8322 super(RngDeviceWriter, self).__init__() 8323 8324 @staticmethod 8325 def write_one(obj, writer, singular=None): 8326 if singular is None: 8327 singular = 'rng_device' 8328 writer.write_start(singular) 8329 href = obj.href 8330 if href is not None: 8331 writer.write_attribute('href', href) 8332 if obj.rate is not None: 8333 RateWriter.write_one(obj.rate, writer, 'rate') 8334 if obj.source is not None: 8335 Writer.write_string(writer, 'source', obj.source.value) 8336 writer.write_end() 8337 8338 @staticmethod 8339 def write_many(objs, writer, singular=None, plural=None): 8340 if singular is None: 8341 singular = 'rng_device' 8342 if plural is None: 8343 plural = 'rng_devices' 8344 writer.write_start(plural) 8345 if isinstance(objs, List): 8346 href = objs.href 8347 if href is not None: 8348 writer.write_attribute('href', href) 8349 for obj in objs: 8350 RngDeviceWriter.write_one(obj, writer, singular) 8351 writer.write_end() 8352 8353 8354class RoleWriter(Writer): 8355 8356 def __init__(self): 8357 super(RoleWriter, self).__init__() 8358 8359 @staticmethod 8360 def write_one(obj, writer, singular=None): 8361 if singular is None: 8362 singular = 'role' 8363 writer.write_start(singular) 8364 href = obj.href 8365 if href is not None: 8366 writer.write_attribute('href', href) 8367 if obj.id is not None: 8368 writer.write_attribute('id', obj.id) 8369 if obj.administrative is not None: 8370 Writer.write_boolean(writer, 'administrative', obj.administrative) 8371 if obj.comment is not None: 8372 Writer.write_string(writer, 'comment', obj.comment) 8373 if obj.description is not None: 8374 Writer.write_string(writer, 'description', obj.description) 8375 if obj.mutable is not None: 8376 Writer.write_boolean(writer, 'mutable', obj.mutable) 8377 if obj.name is not None: 8378 Writer.write_string(writer, 'name', obj.name) 8379 if obj.permits is not None: 8380 PermitWriter.write_many(obj.permits, writer, 'permit', 'permits') 8381 if obj.user is not None: 8382 UserWriter.write_one(obj.user, writer, 'user') 8383 writer.write_end() 8384 8385 @staticmethod 8386 def write_many(objs, writer, singular=None, plural=None): 8387 if singular is None: 8388 singular = 'role' 8389 if plural is None: 8390 plural = 'roles' 8391 writer.write_start(plural) 8392 if isinstance(objs, List): 8393 href = objs.href 8394 if href is not None: 8395 writer.write_attribute('href', href) 8396 for obj in objs: 8397 RoleWriter.write_one(obj, writer, singular) 8398 writer.write_end() 8399 8400 8401class SchedulingPolicyWriter(Writer): 8402 8403 def __init__(self): 8404 super(SchedulingPolicyWriter, self).__init__() 8405 8406 @staticmethod 8407 def write_one(obj, writer, singular=None): 8408 if singular is None: 8409 singular = 'scheduling_policy' 8410 writer.write_start(singular) 8411 href = obj.href 8412 if href is not None: 8413 writer.write_attribute('href', href) 8414 if obj.id is not None: 8415 writer.write_attribute('id', obj.id) 8416 if obj.comment is not None: 8417 Writer.write_string(writer, 'comment', obj.comment) 8418 if obj.default_policy is not None: 8419 Writer.write_boolean(writer, 'default_policy', obj.default_policy) 8420 if obj.description is not None: 8421 Writer.write_string(writer, 'description', obj.description) 8422 if obj.locked is not None: 8423 Writer.write_boolean(writer, 'locked', obj.locked) 8424 if obj.name is not None: 8425 Writer.write_string(writer, 'name', obj.name) 8426 if obj.properties is not None: 8427 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 8428 if obj.balances is not None: 8429 BalanceWriter.write_many(obj.balances, writer, 'balance', 'balances') 8430 if obj.filters is not None: 8431 FilterWriter.write_many(obj.filters, writer, 'filter', 'filters') 8432 if obj.weight is not None: 8433 WeightWriter.write_many(obj.weight, writer, 'weight', 'weight') 8434 writer.write_end() 8435 8436 @staticmethod 8437 def write_many(objs, writer, singular=None, plural=None): 8438 if singular is None: 8439 singular = 'scheduling_policy' 8440 if plural is None: 8441 plural = 'scheduling_policies' 8442 writer.write_start(plural) 8443 if isinstance(objs, List): 8444 href = objs.href 8445 if href is not None: 8446 writer.write_attribute('href', href) 8447 for obj in objs: 8448 SchedulingPolicyWriter.write_one(obj, writer, singular) 8449 writer.write_end() 8450 8451 8452class SchedulingPolicyUnitWriter(Writer): 8453 8454 def __init__(self): 8455 super(SchedulingPolicyUnitWriter, self).__init__() 8456 8457 @staticmethod 8458 def write_one(obj, writer, singular=None): 8459 if singular is None: 8460 singular = 'scheduling_policy_unit' 8461 writer.write_start(singular) 8462 href = obj.href 8463 if href is not None: 8464 writer.write_attribute('href', href) 8465 if obj.id is not None: 8466 writer.write_attribute('id', obj.id) 8467 if obj.comment is not None: 8468 Writer.write_string(writer, 'comment', obj.comment) 8469 if obj.description is not None: 8470 Writer.write_string(writer, 'description', obj.description) 8471 if obj.enabled is not None: 8472 Writer.write_boolean(writer, 'enabled', obj.enabled) 8473 if obj.internal is not None: 8474 Writer.write_boolean(writer, 'internal', obj.internal) 8475 if obj.name is not None: 8476 Writer.write_string(writer, 'name', obj.name) 8477 if obj.properties is not None: 8478 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 8479 if obj.type is not None: 8480 Writer.write_string(writer, 'type', obj.type.value) 8481 writer.write_end() 8482 8483 @staticmethod 8484 def write_many(objs, writer, singular=None, plural=None): 8485 if singular is None: 8486 singular = 'scheduling_policy_unit' 8487 if plural is None: 8488 plural = 'scheduling_policy_units' 8489 writer.write_start(plural) 8490 if isinstance(objs, List): 8491 href = objs.href 8492 if href is not None: 8493 writer.write_attribute('href', href) 8494 for obj in objs: 8495 SchedulingPolicyUnitWriter.write_one(obj, writer, singular) 8496 writer.write_end() 8497 8498 8499class SeLinuxWriter(Writer): 8500 8501 def __init__(self): 8502 super(SeLinuxWriter, self).__init__() 8503 8504 @staticmethod 8505 def write_one(obj, writer, singular=None): 8506 if singular is None: 8507 singular = 'se_linux' 8508 writer.write_start(singular) 8509 href = obj.href 8510 if href is not None: 8511 writer.write_attribute('href', href) 8512 if obj.mode is not None: 8513 Writer.write_string(writer, 'mode', obj.mode.value) 8514 writer.write_end() 8515 8516 @staticmethod 8517 def write_many(objs, writer, singular=None, plural=None): 8518 if singular is None: 8519 singular = 'se_linux' 8520 if plural is None: 8521 plural = 'se_linuxs' 8522 writer.write_start(plural) 8523 if isinstance(objs, List): 8524 href = objs.href 8525 if href is not None: 8526 writer.write_attribute('href', href) 8527 for obj in objs: 8528 SeLinuxWriter.write_one(obj, writer, singular) 8529 writer.write_end() 8530 8531 8532class SerialNumberWriter(Writer): 8533 8534 def __init__(self): 8535 super(SerialNumberWriter, self).__init__() 8536 8537 @staticmethod 8538 def write_one(obj, writer, singular=None): 8539 if singular is None: 8540 singular = 'serial_number' 8541 writer.write_start(singular) 8542 href = obj.href 8543 if href is not None: 8544 writer.write_attribute('href', href) 8545 if obj.policy is not None: 8546 Writer.write_string(writer, 'policy', obj.policy.value) 8547 if obj.value is not None: 8548 Writer.write_string(writer, 'value', obj.value) 8549 writer.write_end() 8550 8551 @staticmethod 8552 def write_many(objs, writer, singular=None, plural=None): 8553 if singular is None: 8554 singular = 'serial_number' 8555 if plural is None: 8556 plural = 'serial_numbers' 8557 writer.write_start(plural) 8558 if isinstance(objs, List): 8559 href = objs.href 8560 if href is not None: 8561 writer.write_attribute('href', href) 8562 for obj in objs: 8563 SerialNumberWriter.write_one(obj, writer, singular) 8564 writer.write_end() 8565 8566 8567class SessionWriter(Writer): 8568 8569 def __init__(self): 8570 super(SessionWriter, self).__init__() 8571 8572 @staticmethod 8573 def write_one(obj, writer, singular=None): 8574 if singular is None: 8575 singular = 'session' 8576 writer.write_start(singular) 8577 href = obj.href 8578 if href is not None: 8579 writer.write_attribute('href', href) 8580 if obj.id is not None: 8581 writer.write_attribute('id', obj.id) 8582 if obj.comment is not None: 8583 Writer.write_string(writer, 'comment', obj.comment) 8584 if obj.console_user is not None: 8585 Writer.write_boolean(writer, 'console_user', obj.console_user) 8586 if obj.description is not None: 8587 Writer.write_string(writer, 'description', obj.description) 8588 if obj.ip is not None: 8589 IpWriter.write_one(obj.ip, writer, 'ip') 8590 if obj.name is not None: 8591 Writer.write_string(writer, 'name', obj.name) 8592 if obj.protocol is not None: 8593 Writer.write_string(writer, 'protocol', obj.protocol) 8594 if obj.user is not None: 8595 UserWriter.write_one(obj.user, writer, 'user') 8596 if obj.vm is not None: 8597 VmWriter.write_one(obj.vm, writer, 'vm') 8598 writer.write_end() 8599 8600 @staticmethod 8601 def write_many(objs, writer, singular=None, plural=None): 8602 if singular is None: 8603 singular = 'session' 8604 if plural is None: 8605 plural = 'sessions' 8606 writer.write_start(plural) 8607 if isinstance(objs, List): 8608 href = objs.href 8609 if href is not None: 8610 writer.write_attribute('href', href) 8611 for obj in objs: 8612 SessionWriter.write_one(obj, writer, singular) 8613 writer.write_end() 8614 8615 8616class SkipIfConnectivityBrokenWriter(Writer): 8617 8618 def __init__(self): 8619 super(SkipIfConnectivityBrokenWriter, self).__init__() 8620 8621 @staticmethod 8622 def write_one(obj, writer, singular=None): 8623 if singular is None: 8624 singular = 'skip_if_connectivity_broken' 8625 writer.write_start(singular) 8626 href = obj.href 8627 if href is not None: 8628 writer.write_attribute('href', href) 8629 if obj.enabled is not None: 8630 Writer.write_boolean(writer, 'enabled', obj.enabled) 8631 if obj.threshold is not None: 8632 Writer.write_integer(writer, 'threshold', obj.threshold) 8633 writer.write_end() 8634 8635 @staticmethod 8636 def write_many(objs, writer, singular=None, plural=None): 8637 if singular is None: 8638 singular = 'skip_if_connectivity_broken' 8639 if plural is None: 8640 plural = 'skip_if_connectivity_brokens' 8641 writer.write_start(plural) 8642 if isinstance(objs, List): 8643 href = objs.href 8644 if href is not None: 8645 writer.write_attribute('href', href) 8646 for obj in objs: 8647 SkipIfConnectivityBrokenWriter.write_one(obj, writer, singular) 8648 writer.write_end() 8649 8650 8651class SkipIfSdActiveWriter(Writer): 8652 8653 def __init__(self): 8654 super(SkipIfSdActiveWriter, self).__init__() 8655 8656 @staticmethod 8657 def write_one(obj, writer, singular=None): 8658 if singular is None: 8659 singular = 'skip_if_sd_active' 8660 writer.write_start(singular) 8661 href = obj.href 8662 if href is not None: 8663 writer.write_attribute('href', href) 8664 if obj.enabled is not None: 8665 Writer.write_boolean(writer, 'enabled', obj.enabled) 8666 writer.write_end() 8667 8668 @staticmethod 8669 def write_many(objs, writer, singular=None, plural=None): 8670 if singular is None: 8671 singular = 'skip_if_sd_active' 8672 if plural is None: 8673 plural = 'skip_if_sd_actives' 8674 writer.write_start(plural) 8675 if isinstance(objs, List): 8676 href = objs.href 8677 if href is not None: 8678 writer.write_attribute('href', href) 8679 for obj in objs: 8680 SkipIfSdActiveWriter.write_one(obj, writer, singular) 8681 writer.write_end() 8682 8683 8684class SnapshotWriter(Writer): 8685 8686 def __init__(self): 8687 super(SnapshotWriter, self).__init__() 8688 8689 @staticmethod 8690 def write_one(obj, writer, singular=None): 8691 if singular is None: 8692 singular = 'snapshot' 8693 writer.write_start(singular) 8694 href = obj.href 8695 if href is not None: 8696 writer.write_attribute('href', href) 8697 if obj.id is not None: 8698 writer.write_attribute('id', obj.id) 8699 if obj.auto_pinning_policy is not None: 8700 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 8701 if obj.bios is not None: 8702 BiosWriter.write_one(obj.bios, writer, 'bios') 8703 if obj.comment is not None: 8704 Writer.write_string(writer, 'comment', obj.comment) 8705 if obj.console is not None: 8706 ConsoleWriter.write_one(obj.console, writer, 'console') 8707 if obj.cpu is not None: 8708 CpuWriter.write_one(obj.cpu, writer, 'cpu') 8709 if obj.cpu_pinning_policy is not None: 8710 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 8711 if obj.cpu_shares is not None: 8712 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 8713 if obj.creation_time is not None: 8714 Writer.write_date(writer, 'creation_time', obj.creation_time) 8715 if obj.custom_compatibility_version is not None: 8716 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 8717 if obj.custom_cpu_model is not None: 8718 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 8719 if obj.custom_emulated_machine is not None: 8720 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 8721 if obj.custom_properties is not None: 8722 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 8723 if obj.date is not None: 8724 Writer.write_date(writer, 'date', obj.date) 8725 if obj.delete_protected is not None: 8726 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 8727 if obj.description is not None: 8728 Writer.write_string(writer, 'description', obj.description) 8729 if obj.display is not None: 8730 DisplayWriter.write_one(obj.display, writer, 'display') 8731 if obj.domain is not None: 8732 DomainWriter.write_one(obj.domain, writer, 'domain') 8733 if obj.fqdn is not None: 8734 Writer.write_string(writer, 'fqdn', obj.fqdn) 8735 if obj.guest_operating_system is not None: 8736 GuestOperatingSystemWriter.write_one(obj.guest_operating_system, writer, 'guest_operating_system') 8737 if obj.guest_time_zone is not None: 8738 TimeZoneWriter.write_one(obj.guest_time_zone, writer, 'guest_time_zone') 8739 if obj.has_illegal_images is not None: 8740 Writer.write_boolean(writer, 'has_illegal_images', obj.has_illegal_images) 8741 if obj.high_availability is not None: 8742 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 8743 if obj.initialization is not None: 8744 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 8745 if obj.io is not None: 8746 IoWriter.write_one(obj.io, writer, 'io') 8747 if obj.large_icon is not None: 8748 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 8749 if obj.lease is not None: 8750 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 8751 if obj.memory is not None: 8752 Writer.write_integer(writer, 'memory', obj.memory) 8753 if obj.memory_policy is not None: 8754 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 8755 if obj.migration is not None: 8756 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 8757 if obj.migration_downtime is not None: 8758 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 8759 if obj.multi_queues_enabled is not None: 8760 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 8761 if obj.name is not None: 8762 Writer.write_string(writer, 'name', obj.name) 8763 if obj.next_run_configuration_exists is not None: 8764 Writer.write_boolean(writer, 'next_run_configuration_exists', obj.next_run_configuration_exists) 8765 if obj.numa_tune_mode is not None: 8766 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 8767 if obj.origin is not None: 8768 Writer.write_string(writer, 'origin', obj.origin) 8769 if obj.os is not None: 8770 OperatingSystemWriter.write_one(obj.os, writer, 'os') 8771 if obj.payloads is not None: 8772 PayloadWriter.write_many(obj.payloads, writer, 'payload', 'payloads') 8773 if obj.persist_memorystate is not None: 8774 Writer.write_boolean(writer, 'persist_memorystate', obj.persist_memorystate) 8775 if obj.placement_policy is not None: 8776 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 8777 if obj.rng_device is not None: 8778 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 8779 if obj.run_once is not None: 8780 Writer.write_boolean(writer, 'run_once', obj.run_once) 8781 if obj.serial_number is not None: 8782 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 8783 if obj.small_icon is not None: 8784 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 8785 if obj.snapshot_status is not None: 8786 Writer.write_string(writer, 'snapshot_status', obj.snapshot_status.value) 8787 if obj.snapshot_type is not None: 8788 Writer.write_string(writer, 'snapshot_type', obj.snapshot_type.value) 8789 if obj.soundcard_enabled is not None: 8790 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 8791 if obj.sso is not None: 8792 SsoWriter.write_one(obj.sso, writer, 'sso') 8793 if obj.start_paused is not None: 8794 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 8795 if obj.start_time is not None: 8796 Writer.write_date(writer, 'start_time', obj.start_time) 8797 if obj.stateless is not None: 8798 Writer.write_boolean(writer, 'stateless', obj.stateless) 8799 if obj.status is not None: 8800 Writer.write_string(writer, 'status', obj.status.value) 8801 if obj.status_detail is not None: 8802 Writer.write_string(writer, 'status_detail', obj.status_detail) 8803 if obj.stop_reason is not None: 8804 Writer.write_string(writer, 'stop_reason', obj.stop_reason) 8805 if obj.stop_time is not None: 8806 Writer.write_date(writer, 'stop_time', obj.stop_time) 8807 if obj.storage_error_resume_behaviour is not None: 8808 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 8809 if obj.time_zone is not None: 8810 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 8811 if obj.tpm_enabled is not None: 8812 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 8813 if obj.tunnel_migration is not None: 8814 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 8815 if obj.type is not None: 8816 Writer.write_string(writer, 'type', obj.type.value) 8817 if obj.usb is not None: 8818 UsbWriter.write_one(obj.usb, writer, 'usb') 8819 if obj.use_latest_template_version is not None: 8820 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 8821 if obj.virtio_scsi is not None: 8822 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 8823 if obj.virtio_scsi_multi_queues is not None: 8824 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 8825 if obj.virtio_scsi_multi_queues_enabled is not None: 8826 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 8827 if obj.affinity_labels is not None: 8828 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 8829 if obj.applications is not None: 8830 ApplicationWriter.write_many(obj.applications, writer, 'application', 'applications') 8831 if obj.cdroms is not None: 8832 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 8833 if obj.cluster is not None: 8834 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 8835 if obj.cpu_profile is not None: 8836 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 8837 if obj.disk_attachments is not None: 8838 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 8839 if obj.disks is not None: 8840 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 8841 if obj.dynamic_cpu is not None: 8842 DynamicCpuWriter.write_one(obj.dynamic_cpu, writer, 'dynamic_cpu') 8843 if obj.external_host_provider is not None: 8844 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 8845 if obj.floppies is not None: 8846 FloppyWriter.write_many(obj.floppies, writer, 'floppy', 'floppies') 8847 if obj.graphics_consoles is not None: 8848 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 8849 if obj.host is not None: 8850 HostWriter.write_one(obj.host, writer, 'host') 8851 if obj.host_devices is not None: 8852 HostDeviceWriter.write_many(obj.host_devices, writer, 'host_device', 'host_devices') 8853 if obj.instance_type is not None: 8854 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 8855 if obj.katello_errata is not None: 8856 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 8857 if obj.mediated_devices is not None: 8858 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 8859 if obj.nics is not None: 8860 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 8861 if obj.numa_nodes is not None: 8862 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 8863 if obj.original_template is not None: 8864 TemplateWriter.write_one(obj.original_template, writer, 'original_template') 8865 if obj.permissions is not None: 8866 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 8867 if obj.quota is not None: 8868 QuotaWriter.write_one(obj.quota, writer, 'quota') 8869 if obj.reported_devices is not None: 8870 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 8871 if obj.sessions is not None: 8872 SessionWriter.write_many(obj.sessions, writer, 'session', 'sessions') 8873 if obj.snapshots is not None: 8874 SnapshotWriter.write_many(obj.snapshots, writer, 'snapshot', 'snapshots') 8875 if obj.statistics is not None: 8876 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 8877 if obj.storage_domain is not None: 8878 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 8879 if obj.tags is not None: 8880 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 8881 if obj.template is not None: 8882 TemplateWriter.write_one(obj.template, writer, 'template') 8883 if obj.vm is not None: 8884 VmWriter.write_one(obj.vm, writer, 'vm') 8885 if obj.vm_pool is not None: 8886 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 8887 if obj.watchdogs is not None: 8888 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 8889 writer.write_end() 8890 8891 @staticmethod 8892 def write_many(objs, writer, singular=None, plural=None): 8893 if singular is None: 8894 singular = 'snapshot' 8895 if plural is None: 8896 plural = 'snapshots' 8897 writer.write_start(plural) 8898 if isinstance(objs, List): 8899 href = objs.href 8900 if href is not None: 8901 writer.write_attribute('href', href) 8902 for obj in objs: 8903 SnapshotWriter.write_one(obj, writer, singular) 8904 writer.write_end() 8905 8906 8907class SpecialObjectsWriter(Writer): 8908 8909 def __init__(self): 8910 super(SpecialObjectsWriter, self).__init__() 8911 8912 @staticmethod 8913 def write_one(obj, writer, singular=None): 8914 if singular is None: 8915 singular = 'special_objects' 8916 writer.write_start(singular) 8917 href = obj.href 8918 if href is not None: 8919 writer.write_attribute('href', href) 8920 if obj.blank_template is not None: 8921 TemplateWriter.write_one(obj.blank_template, writer, 'blank_template') 8922 if obj.root_tag is not None: 8923 TagWriter.write_one(obj.root_tag, writer, 'root_tag') 8924 writer.write_end() 8925 8926 @staticmethod 8927 def write_many(objs, writer, singular=None, plural=None): 8928 if singular is None: 8929 singular = 'special_objects' 8930 if plural is None: 8931 plural = 'special_objectss' 8932 writer.write_start(plural) 8933 if isinstance(objs, List): 8934 href = objs.href 8935 if href is not None: 8936 writer.write_attribute('href', href) 8937 for obj in objs: 8938 SpecialObjectsWriter.write_one(obj, writer, singular) 8939 writer.write_end() 8940 8941 8942class SpmWriter(Writer): 8943 8944 def __init__(self): 8945 super(SpmWriter, self).__init__() 8946 8947 @staticmethod 8948 def write_one(obj, writer, singular=None): 8949 if singular is None: 8950 singular = 'spm' 8951 writer.write_start(singular) 8952 href = obj.href 8953 if href is not None: 8954 writer.write_attribute('href', href) 8955 if obj.priority is not None: 8956 Writer.write_integer(writer, 'priority', obj.priority) 8957 if obj.status is not None: 8958 Writer.write_string(writer, 'status', obj.status.value) 8959 writer.write_end() 8960 8961 @staticmethod 8962 def write_many(objs, writer, singular=None, plural=None): 8963 if singular is None: 8964 singular = 'spm' 8965 if plural is None: 8966 plural = 'spms' 8967 writer.write_start(plural) 8968 if isinstance(objs, List): 8969 href = objs.href 8970 if href is not None: 8971 writer.write_attribute('href', href) 8972 for obj in objs: 8973 SpmWriter.write_one(obj, writer, singular) 8974 writer.write_end() 8975 8976 8977class SshWriter(Writer): 8978 8979 def __init__(self): 8980 super(SshWriter, self).__init__() 8981 8982 @staticmethod 8983 def write_one(obj, writer, singular=None): 8984 if singular is None: 8985 singular = 'ssh' 8986 writer.write_start(singular) 8987 href = obj.href 8988 if href is not None: 8989 writer.write_attribute('href', href) 8990 if obj.id is not None: 8991 writer.write_attribute('id', obj.id) 8992 if obj.authentication_method is not None: 8993 Writer.write_string(writer, 'authentication_method', obj.authentication_method.value) 8994 if obj.comment is not None: 8995 Writer.write_string(writer, 'comment', obj.comment) 8996 if obj.description is not None: 8997 Writer.write_string(writer, 'description', obj.description) 8998 if obj.fingerprint is not None: 8999 Writer.write_string(writer, 'fingerprint', obj.fingerprint) 9000 if obj.name is not None: 9001 Writer.write_string(writer, 'name', obj.name) 9002 if obj.port is not None: 9003 Writer.write_integer(writer, 'port', obj.port) 9004 if obj.public_key is not None: 9005 Writer.write_string(writer, 'public_key', obj.public_key) 9006 if obj.user is not None: 9007 UserWriter.write_one(obj.user, writer, 'user') 9008 writer.write_end() 9009 9010 @staticmethod 9011 def write_many(objs, writer, singular=None, plural=None): 9012 if singular is None: 9013 singular = 'ssh' 9014 if plural is None: 9015 plural = 'sshs' 9016 writer.write_start(plural) 9017 if isinstance(objs, List): 9018 href = objs.href 9019 if href is not None: 9020 writer.write_attribute('href', href) 9021 for obj in objs: 9022 SshWriter.write_one(obj, writer, singular) 9023 writer.write_end() 9024 9025 9026class SshPublicKeyWriter(Writer): 9027 9028 def __init__(self): 9029 super(SshPublicKeyWriter, self).__init__() 9030 9031 @staticmethod 9032 def write_one(obj, writer, singular=None): 9033 if singular is None: 9034 singular = 'ssh_public_key' 9035 writer.write_start(singular) 9036 href = obj.href 9037 if href is not None: 9038 writer.write_attribute('href', href) 9039 if obj.id is not None: 9040 writer.write_attribute('id', obj.id) 9041 if obj.comment is not None: 9042 Writer.write_string(writer, 'comment', obj.comment) 9043 if obj.content is not None: 9044 Writer.write_string(writer, 'content', obj.content) 9045 if obj.description is not None: 9046 Writer.write_string(writer, 'description', obj.description) 9047 if obj.name is not None: 9048 Writer.write_string(writer, 'name', obj.name) 9049 if obj.user is not None: 9050 UserWriter.write_one(obj.user, writer, 'user') 9051 writer.write_end() 9052 9053 @staticmethod 9054 def write_many(objs, writer, singular=None, plural=None): 9055 if singular is None: 9056 singular = 'ssh_public_key' 9057 if plural is None: 9058 plural = 'ssh_public_keys' 9059 writer.write_start(plural) 9060 if isinstance(objs, List): 9061 href = objs.href 9062 if href is not None: 9063 writer.write_attribute('href', href) 9064 for obj in objs: 9065 SshPublicKeyWriter.write_one(obj, writer, singular) 9066 writer.write_end() 9067 9068 9069class SsoWriter(Writer): 9070 9071 def __init__(self): 9072 super(SsoWriter, self).__init__() 9073 9074 @staticmethod 9075 def write_one(obj, writer, singular=None): 9076 if singular is None: 9077 singular = 'sso' 9078 writer.write_start(singular) 9079 href = obj.href 9080 if href is not None: 9081 writer.write_attribute('href', href) 9082 if obj.methods is not None: 9083 MethodWriter.write_many(obj.methods, writer, 'method', 'methods') 9084 writer.write_end() 9085 9086 @staticmethod 9087 def write_many(objs, writer, singular=None, plural=None): 9088 if singular is None: 9089 singular = 'sso' 9090 if plural is None: 9091 plural = 'ssos' 9092 writer.write_start(plural) 9093 if isinstance(objs, List): 9094 href = objs.href 9095 if href is not None: 9096 writer.write_attribute('href', href) 9097 for obj in objs: 9098 SsoWriter.write_one(obj, writer, singular) 9099 writer.write_end() 9100 9101 9102class StatisticWriter(Writer): 9103 9104 def __init__(self): 9105 super(StatisticWriter, self).__init__() 9106 9107 @staticmethod 9108 def write_one(obj, writer, singular=None): 9109 if singular is None: 9110 singular = 'statistic' 9111 writer.write_start(singular) 9112 href = obj.href 9113 if href is not None: 9114 writer.write_attribute('href', href) 9115 if obj.id is not None: 9116 writer.write_attribute('id', obj.id) 9117 if obj.comment is not None: 9118 Writer.write_string(writer, 'comment', obj.comment) 9119 if obj.description is not None: 9120 Writer.write_string(writer, 'description', obj.description) 9121 if obj.kind is not None: 9122 Writer.write_string(writer, 'kind', obj.kind.value) 9123 if obj.name is not None: 9124 Writer.write_string(writer, 'name', obj.name) 9125 if obj.type is not None: 9126 Writer.write_string(writer, 'type', obj.type.value) 9127 if obj.unit is not None: 9128 Writer.write_string(writer, 'unit', obj.unit.value) 9129 if obj.values is not None: 9130 ValueWriter.write_many(obj.values, writer, 'value', 'values') 9131 if obj.brick is not None: 9132 GlusterBrickWriter.write_one(obj.brick, writer, 'brick') 9133 if obj.disk is not None: 9134 DiskWriter.write_one(obj.disk, writer, 'disk') 9135 if obj.gluster_volume is not None: 9136 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 9137 if obj.host is not None: 9138 HostWriter.write_one(obj.host, writer, 'host') 9139 if obj.host_nic is not None: 9140 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 9141 if obj.host_numa_node is not None: 9142 NumaNodeWriter.write_one(obj.host_numa_node, writer, 'host_numa_node') 9143 if obj.nic is not None: 9144 NicWriter.write_one(obj.nic, writer, 'nic') 9145 if obj.step is not None: 9146 StepWriter.write_one(obj.step, writer, 'step') 9147 if obj.vm is not None: 9148 VmWriter.write_one(obj.vm, writer, 'vm') 9149 writer.write_end() 9150 9151 @staticmethod 9152 def write_many(objs, writer, singular=None, plural=None): 9153 if singular is None: 9154 singular = 'statistic' 9155 if plural is None: 9156 plural = 'statistics' 9157 writer.write_start(plural) 9158 if isinstance(objs, List): 9159 href = objs.href 9160 if href is not None: 9161 writer.write_attribute('href', href) 9162 for obj in objs: 9163 StatisticWriter.write_one(obj, writer, singular) 9164 writer.write_end() 9165 9166 9167class StepWriter(Writer): 9168 9169 def __init__(self): 9170 super(StepWriter, self).__init__() 9171 9172 @staticmethod 9173 def write_one(obj, writer, singular=None): 9174 if singular is None: 9175 singular = 'step' 9176 writer.write_start(singular) 9177 href = obj.href 9178 if href is not None: 9179 writer.write_attribute('href', href) 9180 if obj.id is not None: 9181 writer.write_attribute('id', obj.id) 9182 if obj.comment is not None: 9183 Writer.write_string(writer, 'comment', obj.comment) 9184 if obj.description is not None: 9185 Writer.write_string(writer, 'description', obj.description) 9186 if obj.end_time is not None: 9187 Writer.write_date(writer, 'end_time', obj.end_time) 9188 if obj.external is not None: 9189 Writer.write_boolean(writer, 'external', obj.external) 9190 if obj.external_type is not None: 9191 Writer.write_string(writer, 'external_type', obj.external_type.value) 9192 if obj.name is not None: 9193 Writer.write_string(writer, 'name', obj.name) 9194 if obj.number is not None: 9195 Writer.write_integer(writer, 'number', obj.number) 9196 if obj.progress is not None: 9197 Writer.write_integer(writer, 'progress', obj.progress) 9198 if obj.start_time is not None: 9199 Writer.write_date(writer, 'start_time', obj.start_time) 9200 if obj.status is not None: 9201 Writer.write_string(writer, 'status', obj.status.value) 9202 if obj.type is not None: 9203 Writer.write_string(writer, 'type', obj.type.value) 9204 if obj.execution_host is not None: 9205 HostWriter.write_one(obj.execution_host, writer, 'execution_host') 9206 if obj.job is not None: 9207 JobWriter.write_one(obj.job, writer, 'job') 9208 if obj.parent_step is not None: 9209 StepWriter.write_one(obj.parent_step, writer, 'parent_step') 9210 if obj.statistics is not None: 9211 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 9212 writer.write_end() 9213 9214 @staticmethod 9215 def write_many(objs, writer, singular=None, plural=None): 9216 if singular is None: 9217 singular = 'step' 9218 if plural is None: 9219 plural = 'steps' 9220 writer.write_start(plural) 9221 if isinstance(objs, List): 9222 href = objs.href 9223 if href is not None: 9224 writer.write_attribute('href', href) 9225 for obj in objs: 9226 StepWriter.write_one(obj, writer, singular) 9227 writer.write_end() 9228 9229 9230class StorageConnectionWriter(Writer): 9231 9232 def __init__(self): 9233 super(StorageConnectionWriter, self).__init__() 9234 9235 @staticmethod 9236 def write_one(obj, writer, singular=None): 9237 if singular is None: 9238 singular = 'storage_connection' 9239 writer.write_start(singular) 9240 href = obj.href 9241 if href is not None: 9242 writer.write_attribute('href', href) 9243 if obj.id is not None: 9244 writer.write_attribute('id', obj.id) 9245 if obj.address is not None: 9246 Writer.write_string(writer, 'address', obj.address) 9247 if obj.comment is not None: 9248 Writer.write_string(writer, 'comment', obj.comment) 9249 if obj.description is not None: 9250 Writer.write_string(writer, 'description', obj.description) 9251 if obj.mount_options is not None: 9252 Writer.write_string(writer, 'mount_options', obj.mount_options) 9253 if obj.name is not None: 9254 Writer.write_string(writer, 'name', obj.name) 9255 if obj.nfs_retrans is not None: 9256 Writer.write_integer(writer, 'nfs_retrans', obj.nfs_retrans) 9257 if obj.nfs_timeo is not None: 9258 Writer.write_integer(writer, 'nfs_timeo', obj.nfs_timeo) 9259 if obj.nfs_version is not None: 9260 Writer.write_string(writer, 'nfs_version', obj.nfs_version.value) 9261 if obj.password is not None: 9262 Writer.write_string(writer, 'password', obj.password) 9263 if obj.path is not None: 9264 Writer.write_string(writer, 'path', obj.path) 9265 if obj.port is not None: 9266 Writer.write_integer(writer, 'port', obj.port) 9267 if obj.portal is not None: 9268 Writer.write_string(writer, 'portal', obj.portal) 9269 if obj.target is not None: 9270 Writer.write_string(writer, 'target', obj.target) 9271 if obj.type is not None: 9272 Writer.write_string(writer, 'type', obj.type.value) 9273 if obj.username is not None: 9274 Writer.write_string(writer, 'username', obj.username) 9275 if obj.vfs_type is not None: 9276 Writer.write_string(writer, 'vfs_type', obj.vfs_type) 9277 if obj.gluster_volume is not None: 9278 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 9279 if obj.host is not None: 9280 HostWriter.write_one(obj.host, writer, 'host') 9281 writer.write_end() 9282 9283 @staticmethod 9284 def write_many(objs, writer, singular=None, plural=None): 9285 if singular is None: 9286 singular = 'storage_connection' 9287 if plural is None: 9288 plural = 'storage_connections' 9289 writer.write_start(plural) 9290 if isinstance(objs, List): 9291 href = objs.href 9292 if href is not None: 9293 writer.write_attribute('href', href) 9294 for obj in objs: 9295 StorageConnectionWriter.write_one(obj, writer, singular) 9296 writer.write_end() 9297 9298 9299class StorageConnectionExtensionWriter(Writer): 9300 9301 def __init__(self): 9302 super(StorageConnectionExtensionWriter, self).__init__() 9303 9304 @staticmethod 9305 def write_one(obj, writer, singular=None): 9306 if singular is None: 9307 singular = 'storage_connection_extension' 9308 writer.write_start(singular) 9309 href = obj.href 9310 if href is not None: 9311 writer.write_attribute('href', href) 9312 if obj.id is not None: 9313 writer.write_attribute('id', obj.id) 9314 if obj.comment is not None: 9315 Writer.write_string(writer, 'comment', obj.comment) 9316 if obj.description is not None: 9317 Writer.write_string(writer, 'description', obj.description) 9318 if obj.name is not None: 9319 Writer.write_string(writer, 'name', obj.name) 9320 if obj.password is not None: 9321 Writer.write_string(writer, 'password', obj.password) 9322 if obj.target is not None: 9323 Writer.write_string(writer, 'target', obj.target) 9324 if obj.username is not None: 9325 Writer.write_string(writer, 'username', obj.username) 9326 if obj.host is not None: 9327 HostWriter.write_one(obj.host, writer, 'host') 9328 writer.write_end() 9329 9330 @staticmethod 9331 def write_many(objs, writer, singular=None, plural=None): 9332 if singular is None: 9333 singular = 'storage_connection_extension' 9334 if plural is None: 9335 plural = 'storage_connection_extensions' 9336 writer.write_start(plural) 9337 if isinstance(objs, List): 9338 href = objs.href 9339 if href is not None: 9340 writer.write_attribute('href', href) 9341 for obj in objs: 9342 StorageConnectionExtensionWriter.write_one(obj, writer, singular) 9343 writer.write_end() 9344 9345 9346class StorageDomainWriter(Writer): 9347 9348 def __init__(self): 9349 super(StorageDomainWriter, self).__init__() 9350 9351 @staticmethod 9352 def write_one(obj, writer, singular=None): 9353 if singular is None: 9354 singular = 'storage_domain' 9355 writer.write_start(singular) 9356 href = obj.href 9357 if href is not None: 9358 writer.write_attribute('href', href) 9359 if obj.id is not None: 9360 writer.write_attribute('id', obj.id) 9361 if obj.available is not None: 9362 Writer.write_integer(writer, 'available', obj.available) 9363 if obj.backup is not None: 9364 Writer.write_boolean(writer, 'backup', obj.backup) 9365 if obj.block_size is not None: 9366 Writer.write_integer(writer, 'block_size', obj.block_size) 9367 if obj.comment is not None: 9368 Writer.write_string(writer, 'comment', obj.comment) 9369 if obj.committed is not None: 9370 Writer.write_integer(writer, 'committed', obj.committed) 9371 if obj.critical_space_action_blocker is not None: 9372 Writer.write_integer(writer, 'critical_space_action_blocker', obj.critical_space_action_blocker) 9373 if obj.description is not None: 9374 Writer.write_string(writer, 'description', obj.description) 9375 if obj.discard_after_delete is not None: 9376 Writer.write_boolean(writer, 'discard_after_delete', obj.discard_after_delete) 9377 if obj.external_status is not None: 9378 Writer.write_string(writer, 'external_status', obj.external_status.value) 9379 if obj.import_ is not None: 9380 Writer.write_boolean(writer, 'import', obj.import_) 9381 if obj.master is not None: 9382 Writer.write_boolean(writer, 'master', obj.master) 9383 if obj.name is not None: 9384 Writer.write_string(writer, 'name', obj.name) 9385 if obj.status is not None: 9386 Writer.write_string(writer, 'status', obj.status.value) 9387 if obj.storage is not None: 9388 HostStorageWriter.write_one(obj.storage, writer, 'storage') 9389 if obj.storage_format is not None: 9390 Writer.write_string(writer, 'storage_format', obj.storage_format.value) 9391 if obj.supports_discard is not None: 9392 Writer.write_boolean(writer, 'supports_discard', obj.supports_discard) 9393 if obj.supports_discard_zeroes_data is not None: 9394 Writer.write_boolean(writer, 'supports_discard_zeroes_data', obj.supports_discard_zeroes_data) 9395 if obj.type is not None: 9396 Writer.write_string(writer, 'type', obj.type.value) 9397 if obj.used is not None: 9398 Writer.write_integer(writer, 'used', obj.used) 9399 if obj.warning_low_space_indicator is not None: 9400 Writer.write_integer(writer, 'warning_low_space_indicator', obj.warning_low_space_indicator) 9401 if obj.wipe_after_delete is not None: 9402 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 9403 if obj.data_center is not None: 9404 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 9405 if obj.data_centers is not None: 9406 DataCenterWriter.write_many(obj.data_centers, writer, 'data_center', 'data_centers') 9407 if obj.disk_profiles is not None: 9408 DiskProfileWriter.write_many(obj.disk_profiles, writer, 'disk_profile', 'disk_profiles') 9409 if obj.disk_snapshots is not None: 9410 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 9411 if obj.disks is not None: 9412 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 9413 if obj.files is not None: 9414 FileWriter.write_many(obj.files, writer, 'file', 'files') 9415 if obj.host is not None: 9416 HostWriter.write_one(obj.host, writer, 'host') 9417 if obj.images is not None: 9418 ImageWriter.write_many(obj.images, writer, 'image', 'images') 9419 if obj.permissions is not None: 9420 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 9421 if obj.storage_connections is not None: 9422 StorageConnectionWriter.write_many(obj.storage_connections, writer, 'storage_connection', 'storage_connections') 9423 if obj.templates is not None: 9424 TemplateWriter.write_many(obj.templates, writer, 'template', 'templates') 9425 if obj.vms is not None: 9426 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 9427 writer.write_end() 9428 9429 @staticmethod 9430 def write_many(objs, writer, singular=None, plural=None): 9431 if singular is None: 9432 singular = 'storage_domain' 9433 if plural is None: 9434 plural = 'storage_domains' 9435 writer.write_start(plural) 9436 if isinstance(objs, List): 9437 href = objs.href 9438 if href is not None: 9439 writer.write_attribute('href', href) 9440 for obj in objs: 9441 StorageDomainWriter.write_one(obj, writer, singular) 9442 writer.write_end() 9443 9444 9445class StorageDomainLeaseWriter(Writer): 9446 9447 def __init__(self): 9448 super(StorageDomainLeaseWriter, self).__init__() 9449 9450 @staticmethod 9451 def write_one(obj, writer, singular=None): 9452 if singular is None: 9453 singular = 'storage_domain_lease' 9454 writer.write_start(singular) 9455 href = obj.href 9456 if href is not None: 9457 writer.write_attribute('href', href) 9458 if obj.storage_domain is not None: 9459 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 9460 writer.write_end() 9461 9462 @staticmethod 9463 def write_many(objs, writer, singular=None, plural=None): 9464 if singular is None: 9465 singular = 'storage_domain_lease' 9466 if plural is None: 9467 plural = 'storage_domain_leases' 9468 writer.write_start(plural) 9469 if isinstance(objs, List): 9470 href = objs.href 9471 if href is not None: 9472 writer.write_attribute('href', href) 9473 for obj in objs: 9474 StorageDomainLeaseWriter.write_one(obj, writer, singular) 9475 writer.write_end() 9476 9477 9478class SystemOptionWriter(Writer): 9479 9480 def __init__(self): 9481 super(SystemOptionWriter, self).__init__() 9482 9483 @staticmethod 9484 def write_one(obj, writer, singular=None): 9485 if singular is None: 9486 singular = 'system_option' 9487 writer.write_start(singular) 9488 href = obj.href 9489 if href is not None: 9490 writer.write_attribute('href', href) 9491 if obj.id is not None: 9492 writer.write_attribute('id', obj.id) 9493 if obj.comment is not None: 9494 Writer.write_string(writer, 'comment', obj.comment) 9495 if obj.description is not None: 9496 Writer.write_string(writer, 'description', obj.description) 9497 if obj.name is not None: 9498 Writer.write_string(writer, 'name', obj.name) 9499 if obj.values is not None: 9500 SystemOptionValueWriter.write_many(obj.values, writer, 'system_option_value', 'values') 9501 writer.write_end() 9502 9503 @staticmethod 9504 def write_many(objs, writer, singular=None, plural=None): 9505 if singular is None: 9506 singular = 'system_option' 9507 if plural is None: 9508 plural = 'system_options' 9509 writer.write_start(plural) 9510 if isinstance(objs, List): 9511 href = objs.href 9512 if href is not None: 9513 writer.write_attribute('href', href) 9514 for obj in objs: 9515 SystemOptionWriter.write_one(obj, writer, singular) 9516 writer.write_end() 9517 9518 9519class SystemOptionValueWriter(Writer): 9520 9521 def __init__(self): 9522 super(SystemOptionValueWriter, self).__init__() 9523 9524 @staticmethod 9525 def write_one(obj, writer, singular=None): 9526 if singular is None: 9527 singular = 'system_option_value' 9528 writer.write_start(singular) 9529 href = obj.href 9530 if href is not None: 9531 writer.write_attribute('href', href) 9532 if obj.value is not None: 9533 Writer.write_string(writer, 'value', obj.value) 9534 if obj.version is not None: 9535 Writer.write_string(writer, 'version', obj.version) 9536 writer.write_end() 9537 9538 @staticmethod 9539 def write_many(objs, writer, singular=None, plural=None): 9540 if singular is None: 9541 singular = 'system_option_value' 9542 if plural is None: 9543 plural = 'system_option_values' 9544 writer.write_start(plural) 9545 if isinstance(objs, List): 9546 href = objs.href 9547 if href is not None: 9548 writer.write_attribute('href', href) 9549 for obj in objs: 9550 SystemOptionValueWriter.write_one(obj, writer, singular) 9551 writer.write_end() 9552 9553 9554class TagWriter(Writer): 9555 9556 def __init__(self): 9557 super(TagWriter, self).__init__() 9558 9559 @staticmethod 9560 def write_one(obj, writer, singular=None): 9561 if singular is None: 9562 singular = 'tag' 9563 writer.write_start(singular) 9564 href = obj.href 9565 if href is not None: 9566 writer.write_attribute('href', href) 9567 if obj.id is not None: 9568 writer.write_attribute('id', obj.id) 9569 if obj.comment is not None: 9570 Writer.write_string(writer, 'comment', obj.comment) 9571 if obj.description is not None: 9572 Writer.write_string(writer, 'description', obj.description) 9573 if obj.name is not None: 9574 Writer.write_string(writer, 'name', obj.name) 9575 if obj.group is not None: 9576 GroupWriter.write_one(obj.group, writer, 'group') 9577 if obj.host is not None: 9578 HostWriter.write_one(obj.host, writer, 'host') 9579 if obj.parent is not None: 9580 TagWriter.write_one(obj.parent, writer, 'parent') 9581 if obj.template is not None: 9582 TemplateWriter.write_one(obj.template, writer, 'template') 9583 if obj.user is not None: 9584 UserWriter.write_one(obj.user, writer, 'user') 9585 if obj.vm is not None: 9586 VmWriter.write_one(obj.vm, writer, 'vm') 9587 writer.write_end() 9588 9589 @staticmethod 9590 def write_many(objs, writer, singular=None, plural=None): 9591 if singular is None: 9592 singular = 'tag' 9593 if plural is None: 9594 plural = 'tags' 9595 writer.write_start(plural) 9596 if isinstance(objs, List): 9597 href = objs.href 9598 if href is not None: 9599 writer.write_attribute('href', href) 9600 for obj in objs: 9601 TagWriter.write_one(obj, writer, singular) 9602 writer.write_end() 9603 9604 9605class TemplateWriter(Writer): 9606 9607 def __init__(self): 9608 super(TemplateWriter, self).__init__() 9609 9610 @staticmethod 9611 def write_one(obj, writer, singular=None): 9612 if singular is None: 9613 singular = 'template' 9614 writer.write_start(singular) 9615 href = obj.href 9616 if href is not None: 9617 writer.write_attribute('href', href) 9618 if obj.id is not None: 9619 writer.write_attribute('id', obj.id) 9620 if obj.auto_pinning_policy is not None: 9621 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 9622 if obj.bios is not None: 9623 BiosWriter.write_one(obj.bios, writer, 'bios') 9624 if obj.comment is not None: 9625 Writer.write_string(writer, 'comment', obj.comment) 9626 if obj.console is not None: 9627 ConsoleWriter.write_one(obj.console, writer, 'console') 9628 if obj.cpu is not None: 9629 CpuWriter.write_one(obj.cpu, writer, 'cpu') 9630 if obj.cpu_pinning_policy is not None: 9631 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 9632 if obj.cpu_shares is not None: 9633 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 9634 if obj.creation_time is not None: 9635 Writer.write_date(writer, 'creation_time', obj.creation_time) 9636 if obj.custom_compatibility_version is not None: 9637 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 9638 if obj.custom_cpu_model is not None: 9639 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 9640 if obj.custom_emulated_machine is not None: 9641 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 9642 if obj.custom_properties is not None: 9643 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 9644 if obj.delete_protected is not None: 9645 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 9646 if obj.description is not None: 9647 Writer.write_string(writer, 'description', obj.description) 9648 if obj.display is not None: 9649 DisplayWriter.write_one(obj.display, writer, 'display') 9650 if obj.domain is not None: 9651 DomainWriter.write_one(obj.domain, writer, 'domain') 9652 if obj.high_availability is not None: 9653 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 9654 if obj.initialization is not None: 9655 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 9656 if obj.io is not None: 9657 IoWriter.write_one(obj.io, writer, 'io') 9658 if obj.large_icon is not None: 9659 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 9660 if obj.lease is not None: 9661 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 9662 if obj.memory is not None: 9663 Writer.write_integer(writer, 'memory', obj.memory) 9664 if obj.memory_policy is not None: 9665 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 9666 if obj.migration is not None: 9667 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 9668 if obj.migration_downtime is not None: 9669 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 9670 if obj.multi_queues_enabled is not None: 9671 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 9672 if obj.name is not None: 9673 Writer.write_string(writer, 'name', obj.name) 9674 if obj.origin is not None: 9675 Writer.write_string(writer, 'origin', obj.origin) 9676 if obj.os is not None: 9677 OperatingSystemWriter.write_one(obj.os, writer, 'os') 9678 if obj.placement_policy is not None: 9679 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 9680 if obj.rng_device is not None: 9681 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 9682 if obj.serial_number is not None: 9683 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 9684 if obj.small_icon is not None: 9685 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 9686 if obj.soundcard_enabled is not None: 9687 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 9688 if obj.sso is not None: 9689 SsoWriter.write_one(obj.sso, writer, 'sso') 9690 if obj.start_paused is not None: 9691 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 9692 if obj.stateless is not None: 9693 Writer.write_boolean(writer, 'stateless', obj.stateless) 9694 if obj.status is not None: 9695 Writer.write_string(writer, 'status', obj.status.value) 9696 if obj.storage_error_resume_behaviour is not None: 9697 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 9698 if obj.time_zone is not None: 9699 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 9700 if obj.tpm_enabled is not None: 9701 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 9702 if obj.tunnel_migration is not None: 9703 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 9704 if obj.type is not None: 9705 Writer.write_string(writer, 'type', obj.type.value) 9706 if obj.usb is not None: 9707 UsbWriter.write_one(obj.usb, writer, 'usb') 9708 if obj.version is not None: 9709 TemplateVersionWriter.write_one(obj.version, writer, 'version') 9710 if obj.virtio_scsi is not None: 9711 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 9712 if obj.virtio_scsi_multi_queues is not None: 9713 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 9714 if obj.virtio_scsi_multi_queues_enabled is not None: 9715 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 9716 if obj.vm is not None: 9717 VmWriter.write_one(obj.vm, writer, 'vm') 9718 if obj.cdroms is not None: 9719 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 9720 if obj.cluster is not None: 9721 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 9722 if obj.cpu_profile is not None: 9723 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 9724 if obj.disk_attachments is not None: 9725 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 9726 if obj.graphics_consoles is not None: 9727 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 9728 if obj.mediated_devices is not None: 9729 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 9730 if obj.nics is not None: 9731 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 9732 if obj.permissions is not None: 9733 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 9734 if obj.quota is not None: 9735 QuotaWriter.write_one(obj.quota, writer, 'quota') 9736 if obj.storage_domain is not None: 9737 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 9738 if obj.tags is not None: 9739 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 9740 if obj.watchdogs is not None: 9741 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 9742 writer.write_end() 9743 9744 @staticmethod 9745 def write_many(objs, writer, singular=None, plural=None): 9746 if singular is None: 9747 singular = 'template' 9748 if plural is None: 9749 plural = 'templates' 9750 writer.write_start(plural) 9751 if isinstance(objs, List): 9752 href = objs.href 9753 if href is not None: 9754 writer.write_attribute('href', href) 9755 for obj in objs: 9756 TemplateWriter.write_one(obj, writer, singular) 9757 writer.write_end() 9758 9759 9760class TemplateVersionWriter(Writer): 9761 9762 def __init__(self): 9763 super(TemplateVersionWriter, self).__init__() 9764 9765 @staticmethod 9766 def write_one(obj, writer, singular=None): 9767 if singular is None: 9768 singular = 'template_version' 9769 writer.write_start(singular) 9770 href = obj.href 9771 if href is not None: 9772 writer.write_attribute('href', href) 9773 if obj.version_name is not None: 9774 Writer.write_string(writer, 'version_name', obj.version_name) 9775 if obj.version_number is not None: 9776 Writer.write_integer(writer, 'version_number', obj.version_number) 9777 if obj.base_template is not None: 9778 TemplateWriter.write_one(obj.base_template, writer, 'base_template') 9779 writer.write_end() 9780 9781 @staticmethod 9782 def write_many(objs, writer, singular=None, plural=None): 9783 if singular is None: 9784 singular = 'template_version' 9785 if plural is None: 9786 plural = 'template_versions' 9787 writer.write_start(plural) 9788 if isinstance(objs, List): 9789 href = objs.href 9790 if href is not None: 9791 writer.write_attribute('href', href) 9792 for obj in objs: 9793 TemplateVersionWriter.write_one(obj, writer, singular) 9794 writer.write_end() 9795 9796 9797class TicketWriter(Writer): 9798 9799 def __init__(self): 9800 super(TicketWriter, self).__init__() 9801 9802 @staticmethod 9803 def write_one(obj, writer, singular=None): 9804 if singular is None: 9805 singular = 'ticket' 9806 writer.write_start(singular) 9807 href = obj.href 9808 if href is not None: 9809 writer.write_attribute('href', href) 9810 if obj.expiry is not None: 9811 Writer.write_integer(writer, 'expiry', obj.expiry) 9812 if obj.value is not None: 9813 Writer.write_string(writer, 'value', obj.value) 9814 writer.write_end() 9815 9816 @staticmethod 9817 def write_many(objs, writer, singular=None, plural=None): 9818 if singular is None: 9819 singular = 'ticket' 9820 if plural is None: 9821 plural = 'tickets' 9822 writer.write_start(plural) 9823 if isinstance(objs, List): 9824 href = objs.href 9825 if href is not None: 9826 writer.write_attribute('href', href) 9827 for obj in objs: 9828 TicketWriter.write_one(obj, writer, singular) 9829 writer.write_end() 9830 9831 9832class TimeZoneWriter(Writer): 9833 9834 def __init__(self): 9835 super(TimeZoneWriter, self).__init__() 9836 9837 @staticmethod 9838 def write_one(obj, writer, singular=None): 9839 if singular is None: 9840 singular = 'time_zone' 9841 writer.write_start(singular) 9842 href = obj.href 9843 if href is not None: 9844 writer.write_attribute('href', href) 9845 if obj.name is not None: 9846 Writer.write_string(writer, 'name', obj.name) 9847 if obj.utc_offset is not None: 9848 Writer.write_string(writer, 'utc_offset', obj.utc_offset) 9849 writer.write_end() 9850 9851 @staticmethod 9852 def write_many(objs, writer, singular=None, plural=None): 9853 if singular is None: 9854 singular = 'time_zone' 9855 if plural is None: 9856 plural = 'time_zones' 9857 writer.write_start(plural) 9858 if isinstance(objs, List): 9859 href = objs.href 9860 if href is not None: 9861 writer.write_attribute('href', href) 9862 for obj in objs: 9863 TimeZoneWriter.write_one(obj, writer, singular) 9864 writer.write_end() 9865 9866 9867class TransparentHugePagesWriter(Writer): 9868 9869 def __init__(self): 9870 super(TransparentHugePagesWriter, self).__init__() 9871 9872 @staticmethod 9873 def write_one(obj, writer, singular=None): 9874 if singular is None: 9875 singular = 'transparent_hugepages' 9876 writer.write_start(singular) 9877 href = obj.href 9878 if href is not None: 9879 writer.write_attribute('href', href) 9880 if obj.enabled is not None: 9881 Writer.write_boolean(writer, 'enabled', obj.enabled) 9882 writer.write_end() 9883 9884 @staticmethod 9885 def write_many(objs, writer, singular=None, plural=None): 9886 if singular is None: 9887 singular = 'transparent_hugepages' 9888 if plural is None: 9889 plural = 'transparent_huge_pagess' 9890 writer.write_start(plural) 9891 if isinstance(objs, List): 9892 href = objs.href 9893 if href is not None: 9894 writer.write_attribute('href', href) 9895 for obj in objs: 9896 TransparentHugePagesWriter.write_one(obj, writer, singular) 9897 writer.write_end() 9898 9899 9900class UnmanagedNetworkWriter(Writer): 9901 9902 def __init__(self): 9903 super(UnmanagedNetworkWriter, self).__init__() 9904 9905 @staticmethod 9906 def write_one(obj, writer, singular=None): 9907 if singular is None: 9908 singular = 'unmanaged_network' 9909 writer.write_start(singular) 9910 href = obj.href 9911 if href is not None: 9912 writer.write_attribute('href', href) 9913 if obj.id is not None: 9914 writer.write_attribute('id', obj.id) 9915 if obj.comment is not None: 9916 Writer.write_string(writer, 'comment', obj.comment) 9917 if obj.description is not None: 9918 Writer.write_string(writer, 'description', obj.description) 9919 if obj.name is not None: 9920 Writer.write_string(writer, 'name', obj.name) 9921 if obj.host is not None: 9922 HostWriter.write_one(obj.host, writer, 'host') 9923 if obj.host_nic is not None: 9924 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 9925 writer.write_end() 9926 9927 @staticmethod 9928 def write_many(objs, writer, singular=None, plural=None): 9929 if singular is None: 9930 singular = 'unmanaged_network' 9931 if plural is None: 9932 plural = 'unmanaged_networks' 9933 writer.write_start(plural) 9934 if isinstance(objs, List): 9935 href = objs.href 9936 if href is not None: 9937 writer.write_attribute('href', href) 9938 for obj in objs: 9939 UnmanagedNetworkWriter.write_one(obj, writer, singular) 9940 writer.write_end() 9941 9942 9943class UsbWriter(Writer): 9944 9945 def __init__(self): 9946 super(UsbWriter, self).__init__() 9947 9948 @staticmethod 9949 def write_one(obj, writer, singular=None): 9950 if singular is None: 9951 singular = 'usb' 9952 writer.write_start(singular) 9953 href = obj.href 9954 if href is not None: 9955 writer.write_attribute('href', href) 9956 if obj.enabled is not None: 9957 Writer.write_boolean(writer, 'enabled', obj.enabled) 9958 if obj.type is not None: 9959 Writer.write_string(writer, 'type', obj.type.value) 9960 writer.write_end() 9961 9962 @staticmethod 9963 def write_many(objs, writer, singular=None, plural=None): 9964 if singular is None: 9965 singular = 'usb' 9966 if plural is None: 9967 plural = 'usbs' 9968 writer.write_start(plural) 9969 if isinstance(objs, List): 9970 href = objs.href 9971 if href is not None: 9972 writer.write_attribute('href', href) 9973 for obj in objs: 9974 UsbWriter.write_one(obj, writer, singular) 9975 writer.write_end() 9976 9977 9978class UserWriter(Writer): 9979 9980 def __init__(self): 9981 super(UserWriter, self).__init__() 9982 9983 @staticmethod 9984 def write_one(obj, writer, singular=None): 9985 if singular is None: 9986 singular = 'user' 9987 writer.write_start(singular) 9988 href = obj.href 9989 if href is not None: 9990 writer.write_attribute('href', href) 9991 if obj.id is not None: 9992 writer.write_attribute('id', obj.id) 9993 if obj.comment is not None: 9994 Writer.write_string(writer, 'comment', obj.comment) 9995 if obj.department is not None: 9996 Writer.write_string(writer, 'department', obj.department) 9997 if obj.description is not None: 9998 Writer.write_string(writer, 'description', obj.description) 9999 if obj.domain_entry_id is not None: 10000 Writer.write_string(writer, 'domain_entry_id', obj.domain_entry_id) 10001 if obj.email is not None: 10002 Writer.write_string(writer, 'email', obj.email) 10003 if obj.last_name is not None: 10004 Writer.write_string(writer, 'last_name', obj.last_name) 10005 if obj.logged_in is not None: 10006 Writer.write_boolean(writer, 'logged_in', obj.logged_in) 10007 if obj.name is not None: 10008 Writer.write_string(writer, 'name', obj.name) 10009 if obj.namespace is not None: 10010 Writer.write_string(writer, 'namespace', obj.namespace) 10011 if obj.password is not None: 10012 Writer.write_string(writer, 'password', obj.password) 10013 if obj.principal is not None: 10014 Writer.write_string(writer, 'principal', obj.principal) 10015 if obj.user_name is not None: 10016 Writer.write_string(writer, 'user_name', obj.user_name) 10017 if obj.user_options is not None: 10018 PropertyWriter.write_many(obj.user_options, writer, 'property', 'user_options') 10019 if obj.domain is not None: 10020 DomainWriter.write_one(obj.domain, writer, 'domain') 10021 if obj.groups is not None: 10022 GroupWriter.write_many(obj.groups, writer, 'group', 'groups') 10023 if obj.options is not None: 10024 UserOptionWriter.write_many(obj.options, writer, 'user_option', 'options') 10025 if obj.permissions is not None: 10026 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10027 if obj.roles is not None: 10028 RoleWriter.write_many(obj.roles, writer, 'role', 'roles') 10029 if obj.ssh_public_keys is not None: 10030 SshPublicKeyWriter.write_many(obj.ssh_public_keys, writer, 'ssh_public_key', 'ssh_public_keys') 10031 if obj.tags is not None: 10032 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 10033 writer.write_end() 10034 10035 @staticmethod 10036 def write_many(objs, writer, singular=None, plural=None): 10037 if singular is None: 10038 singular = 'user' 10039 if plural is None: 10040 plural = 'users' 10041 writer.write_start(plural) 10042 if isinstance(objs, List): 10043 href = objs.href 10044 if href is not None: 10045 writer.write_attribute('href', href) 10046 for obj in objs: 10047 UserWriter.write_one(obj, writer, singular) 10048 writer.write_end() 10049 10050 10051class UserOptionWriter(Writer): 10052 10053 def __init__(self): 10054 super(UserOptionWriter, self).__init__() 10055 10056 @staticmethod 10057 def write_one(obj, writer, singular=None): 10058 if singular is None: 10059 singular = 'user_option' 10060 writer.write_start(singular) 10061 href = obj.href 10062 if href is not None: 10063 writer.write_attribute('href', href) 10064 if obj.id is not None: 10065 writer.write_attribute('id', obj.id) 10066 if obj.comment is not None: 10067 Writer.write_string(writer, 'comment', obj.comment) 10068 if obj.content is not None: 10069 Writer.write_string(writer, 'content', obj.content) 10070 if obj.description is not None: 10071 Writer.write_string(writer, 'description', obj.description) 10072 if obj.name is not None: 10073 Writer.write_string(writer, 'name', obj.name) 10074 if obj.user is not None: 10075 UserWriter.write_one(obj.user, writer, 'user') 10076 writer.write_end() 10077 10078 @staticmethod 10079 def write_many(objs, writer, singular=None, plural=None): 10080 if singular is None: 10081 singular = 'user_option' 10082 if plural is None: 10083 plural = 'user_options' 10084 writer.write_start(plural) 10085 if isinstance(objs, List): 10086 href = objs.href 10087 if href is not None: 10088 writer.write_attribute('href', href) 10089 for obj in objs: 10090 UserOptionWriter.write_one(obj, writer, singular) 10091 writer.write_end() 10092 10093 10094class ValueWriter(Writer): 10095 10096 def __init__(self): 10097 super(ValueWriter, self).__init__() 10098 10099 @staticmethod 10100 def write_one(obj, writer, singular=None): 10101 if singular is None: 10102 singular = 'value' 10103 writer.write_start(singular) 10104 href = obj.href 10105 if href is not None: 10106 writer.write_attribute('href', href) 10107 if obj.datum is not None: 10108 Writer.write_decimal(writer, 'datum', obj.datum) 10109 if obj.detail is not None: 10110 Writer.write_string(writer, 'detail', obj.detail) 10111 writer.write_end() 10112 10113 @staticmethod 10114 def write_many(objs, writer, singular=None, plural=None): 10115 if singular is None: 10116 singular = 'value' 10117 if plural is None: 10118 plural = 'values' 10119 writer.write_start(plural) 10120 if isinstance(objs, List): 10121 href = objs.href 10122 if href is not None: 10123 writer.write_attribute('href', href) 10124 for obj in objs: 10125 ValueWriter.write_one(obj, writer, singular) 10126 writer.write_end() 10127 10128 10129class VcpuPinWriter(Writer): 10130 10131 def __init__(self): 10132 super(VcpuPinWriter, self).__init__() 10133 10134 @staticmethod 10135 def write_one(obj, writer, singular=None): 10136 if singular is None: 10137 singular = 'vcpu_pin' 10138 writer.write_start(singular) 10139 href = obj.href 10140 if href is not None: 10141 writer.write_attribute('href', href) 10142 if obj.cpu_set is not None: 10143 Writer.write_string(writer, 'cpu_set', obj.cpu_set) 10144 if obj.vcpu is not None: 10145 Writer.write_integer(writer, 'vcpu', obj.vcpu) 10146 writer.write_end() 10147 10148 @staticmethod 10149 def write_many(objs, writer, singular=None, plural=None): 10150 if singular is None: 10151 singular = 'vcpu_pin' 10152 if plural is None: 10153 plural = 'vcpu_pins' 10154 writer.write_start(plural) 10155 if isinstance(objs, List): 10156 href = objs.href 10157 if href is not None: 10158 writer.write_attribute('href', href) 10159 for obj in objs: 10160 VcpuPinWriter.write_one(obj, writer, singular) 10161 writer.write_end() 10162 10163 10164class VendorWriter(Writer): 10165 10166 def __init__(self): 10167 super(VendorWriter, self).__init__() 10168 10169 @staticmethod 10170 def write_one(obj, writer, singular=None): 10171 if singular is None: 10172 singular = 'vendor' 10173 writer.write_start(singular) 10174 href = obj.href 10175 if href is not None: 10176 writer.write_attribute('href', href) 10177 if obj.id is not None: 10178 writer.write_attribute('id', obj.id) 10179 if obj.comment is not None: 10180 Writer.write_string(writer, 'comment', obj.comment) 10181 if obj.description is not None: 10182 Writer.write_string(writer, 'description', obj.description) 10183 if obj.name is not None: 10184 Writer.write_string(writer, 'name', obj.name) 10185 writer.write_end() 10186 10187 @staticmethod 10188 def write_many(objs, writer, singular=None, plural=None): 10189 if singular is None: 10190 singular = 'vendor' 10191 if plural is None: 10192 plural = 'vendors' 10193 writer.write_start(plural) 10194 if isinstance(objs, List): 10195 href = objs.href 10196 if href is not None: 10197 writer.write_attribute('href', href) 10198 for obj in objs: 10199 VendorWriter.write_one(obj, writer, singular) 10200 writer.write_end() 10201 10202 10203class VersionWriter(Writer): 10204 10205 def __init__(self): 10206 super(VersionWriter, self).__init__() 10207 10208 @staticmethod 10209 def write_one(obj, writer, singular=None): 10210 if singular is None: 10211 singular = 'version' 10212 writer.write_start(singular) 10213 href = obj.href 10214 if href is not None: 10215 writer.write_attribute('href', href) 10216 if obj.id is not None: 10217 writer.write_attribute('id', obj.id) 10218 if obj.build is not None: 10219 Writer.write_integer(writer, 'build', obj.build) 10220 if obj.comment is not None: 10221 Writer.write_string(writer, 'comment', obj.comment) 10222 if obj.description is not None: 10223 Writer.write_string(writer, 'description', obj.description) 10224 if obj.full_version is not None: 10225 Writer.write_string(writer, 'full_version', obj.full_version) 10226 if obj.major is not None: 10227 Writer.write_integer(writer, 'major', obj.major) 10228 if obj.minor is not None: 10229 Writer.write_integer(writer, 'minor', obj.minor) 10230 if obj.name is not None: 10231 Writer.write_string(writer, 'name', obj.name) 10232 if obj.revision is not None: 10233 Writer.write_integer(writer, 'revision', obj.revision) 10234 writer.write_end() 10235 10236 @staticmethod 10237 def write_many(objs, writer, singular=None, plural=None): 10238 if singular is None: 10239 singular = 'version' 10240 if plural is None: 10241 plural = 'versions' 10242 writer.write_start(plural) 10243 if isinstance(objs, List): 10244 href = objs.href 10245 if href is not None: 10246 writer.write_attribute('href', href) 10247 for obj in objs: 10248 VersionWriter.write_one(obj, writer, singular) 10249 writer.write_end() 10250 10251 10252class VirtioScsiWriter(Writer): 10253 10254 def __init__(self): 10255 super(VirtioScsiWriter, self).__init__() 10256 10257 @staticmethod 10258 def write_one(obj, writer, singular=None): 10259 if singular is None: 10260 singular = 'virtio_scsi' 10261 writer.write_start(singular) 10262 href = obj.href 10263 if href is not None: 10264 writer.write_attribute('href', href) 10265 if obj.enabled is not None: 10266 Writer.write_boolean(writer, 'enabled', obj.enabled) 10267 writer.write_end() 10268 10269 @staticmethod 10270 def write_many(objs, writer, singular=None, plural=None): 10271 if singular is None: 10272 singular = 'virtio_scsi' 10273 if plural is None: 10274 plural = 'virtio_scsis' 10275 writer.write_start(plural) 10276 if isinstance(objs, List): 10277 href = objs.href 10278 if href is not None: 10279 writer.write_attribute('href', href) 10280 for obj in objs: 10281 VirtioScsiWriter.write_one(obj, writer, singular) 10282 writer.write_end() 10283 10284 10285class VirtualNumaNodeWriter(Writer): 10286 10287 def __init__(self): 10288 super(VirtualNumaNodeWriter, self).__init__() 10289 10290 @staticmethod 10291 def write_one(obj, writer, singular=None): 10292 if singular is None: 10293 singular = 'vm_numa_node' 10294 writer.write_start(singular) 10295 href = obj.href 10296 if href is not None: 10297 writer.write_attribute('href', href) 10298 if obj.id is not None: 10299 writer.write_attribute('id', obj.id) 10300 if obj.comment is not None: 10301 Writer.write_string(writer, 'comment', obj.comment) 10302 if obj.cpu is not None: 10303 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10304 if obj.description is not None: 10305 Writer.write_string(writer, 'description', obj.description) 10306 if obj.index is not None: 10307 Writer.write_integer(writer, 'index', obj.index) 10308 if obj.memory is not None: 10309 Writer.write_integer(writer, 'memory', obj.memory) 10310 if obj.name is not None: 10311 Writer.write_string(writer, 'name', obj.name) 10312 if obj.node_distance is not None: 10313 Writer.write_string(writer, 'node_distance', obj.node_distance) 10314 if obj.numa_node_pins is not None: 10315 NumaNodePinWriter.write_many(obj.numa_node_pins, writer, 'numa_node_pin', 'numa_node_pins') 10316 if obj.numa_tune_mode is not None: 10317 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 10318 if obj.host is not None: 10319 HostWriter.write_one(obj.host, writer, 'host') 10320 if obj.statistics is not None: 10321 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 10322 if obj.vm is not None: 10323 VmWriter.write_one(obj.vm, writer, 'vm') 10324 writer.write_end() 10325 10326 @staticmethod 10327 def write_many(objs, writer, singular=None, plural=None): 10328 if singular is None: 10329 singular = 'vm_numa_node' 10330 if plural is None: 10331 plural = 'vm_numa_nodes' 10332 writer.write_start(plural) 10333 if isinstance(objs, List): 10334 href = objs.href 10335 if href is not None: 10336 writer.write_attribute('href', href) 10337 for obj in objs: 10338 VirtualNumaNodeWriter.write_one(obj, writer, singular) 10339 writer.write_end() 10340 10341 10342class VlanWriter(Writer): 10343 10344 def __init__(self): 10345 super(VlanWriter, self).__init__() 10346 10347 @staticmethod 10348 def write_one(obj, writer, singular=None): 10349 if singular is None: 10350 singular = 'vlan' 10351 writer.write_start(singular) 10352 href = obj.href 10353 if href is not None: 10354 writer.write_attribute('href', href) 10355 if obj.id is not None: 10356 writer.write_attribute('id', str(obj.id)) 10357 writer.write_end() 10358 10359 @staticmethod 10360 def write_many(objs, writer, singular=None, plural=None): 10361 if singular is None: 10362 singular = 'vlan' 10363 if plural is None: 10364 plural = 'vlans' 10365 writer.write_start(plural) 10366 if isinstance(objs, List): 10367 href = objs.href 10368 if href is not None: 10369 writer.write_attribute('href', href) 10370 for obj in objs: 10371 VlanWriter.write_one(obj, writer, singular) 10372 writer.write_end() 10373 10374 10375class VmWriter(Writer): 10376 10377 def __init__(self): 10378 super(VmWriter, self).__init__() 10379 10380 @staticmethod 10381 def write_one(obj, writer, singular=None): 10382 if singular is None: 10383 singular = 'vm' 10384 writer.write_start(singular) 10385 href = obj.href 10386 if href is not None: 10387 writer.write_attribute('href', href) 10388 if obj.id is not None: 10389 writer.write_attribute('id', obj.id) 10390 if obj.auto_pinning_policy is not None: 10391 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 10392 if obj.bios is not None: 10393 BiosWriter.write_one(obj.bios, writer, 'bios') 10394 if obj.comment is not None: 10395 Writer.write_string(writer, 'comment', obj.comment) 10396 if obj.console is not None: 10397 ConsoleWriter.write_one(obj.console, writer, 'console') 10398 if obj.cpu is not None: 10399 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10400 if obj.cpu_pinning_policy is not None: 10401 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 10402 if obj.cpu_shares is not None: 10403 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 10404 if obj.creation_time is not None: 10405 Writer.write_date(writer, 'creation_time', obj.creation_time) 10406 if obj.custom_compatibility_version is not None: 10407 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 10408 if obj.custom_cpu_model is not None: 10409 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 10410 if obj.custom_emulated_machine is not None: 10411 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 10412 if obj.custom_properties is not None: 10413 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10414 if obj.delete_protected is not None: 10415 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 10416 if obj.description is not None: 10417 Writer.write_string(writer, 'description', obj.description) 10418 if obj.display is not None: 10419 DisplayWriter.write_one(obj.display, writer, 'display') 10420 if obj.domain is not None: 10421 DomainWriter.write_one(obj.domain, writer, 'domain') 10422 if obj.fqdn is not None: 10423 Writer.write_string(writer, 'fqdn', obj.fqdn) 10424 if obj.guest_operating_system is not None: 10425 GuestOperatingSystemWriter.write_one(obj.guest_operating_system, writer, 'guest_operating_system') 10426 if obj.guest_time_zone is not None: 10427 TimeZoneWriter.write_one(obj.guest_time_zone, writer, 'guest_time_zone') 10428 if obj.has_illegal_images is not None: 10429 Writer.write_boolean(writer, 'has_illegal_images', obj.has_illegal_images) 10430 if obj.high_availability is not None: 10431 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 10432 if obj.initialization is not None: 10433 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 10434 if obj.io is not None: 10435 IoWriter.write_one(obj.io, writer, 'io') 10436 if obj.large_icon is not None: 10437 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 10438 if obj.lease is not None: 10439 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 10440 if obj.memory is not None: 10441 Writer.write_integer(writer, 'memory', obj.memory) 10442 if obj.memory_policy is not None: 10443 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 10444 if obj.migration is not None: 10445 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 10446 if obj.migration_downtime is not None: 10447 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 10448 if obj.multi_queues_enabled is not None: 10449 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 10450 if obj.name is not None: 10451 Writer.write_string(writer, 'name', obj.name) 10452 if obj.next_run_configuration_exists is not None: 10453 Writer.write_boolean(writer, 'next_run_configuration_exists', obj.next_run_configuration_exists) 10454 if obj.numa_tune_mode is not None: 10455 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 10456 if obj.origin is not None: 10457 Writer.write_string(writer, 'origin', obj.origin) 10458 if obj.os is not None: 10459 OperatingSystemWriter.write_one(obj.os, writer, 'os') 10460 if obj.payloads is not None: 10461 PayloadWriter.write_many(obj.payloads, writer, 'payload', 'payloads') 10462 if obj.placement_policy is not None: 10463 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 10464 if obj.rng_device is not None: 10465 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10466 if obj.run_once is not None: 10467 Writer.write_boolean(writer, 'run_once', obj.run_once) 10468 if obj.serial_number is not None: 10469 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 10470 if obj.small_icon is not None: 10471 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 10472 if obj.soundcard_enabled is not None: 10473 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10474 if obj.sso is not None: 10475 SsoWriter.write_one(obj.sso, writer, 'sso') 10476 if obj.start_paused is not None: 10477 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 10478 if obj.start_time is not None: 10479 Writer.write_date(writer, 'start_time', obj.start_time) 10480 if obj.stateless is not None: 10481 Writer.write_boolean(writer, 'stateless', obj.stateless) 10482 if obj.status is not None: 10483 Writer.write_string(writer, 'status', obj.status.value) 10484 if obj.status_detail is not None: 10485 Writer.write_string(writer, 'status_detail', obj.status_detail) 10486 if obj.stop_reason is not None: 10487 Writer.write_string(writer, 'stop_reason', obj.stop_reason) 10488 if obj.stop_time is not None: 10489 Writer.write_date(writer, 'stop_time', obj.stop_time) 10490 if obj.storage_error_resume_behaviour is not None: 10491 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 10492 if obj.time_zone is not None: 10493 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 10494 if obj.tpm_enabled is not None: 10495 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10496 if obj.tunnel_migration is not None: 10497 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 10498 if obj.type is not None: 10499 Writer.write_string(writer, 'type', obj.type.value) 10500 if obj.usb is not None: 10501 UsbWriter.write_one(obj.usb, writer, 'usb') 10502 if obj.use_latest_template_version is not None: 10503 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 10504 if obj.virtio_scsi is not None: 10505 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 10506 if obj.virtio_scsi_multi_queues is not None: 10507 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 10508 if obj.virtio_scsi_multi_queues_enabled is not None: 10509 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 10510 if obj.affinity_labels is not None: 10511 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 10512 if obj.applications is not None: 10513 ApplicationWriter.write_many(obj.applications, writer, 'application', 'applications') 10514 if obj.cdroms is not None: 10515 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 10516 if obj.cluster is not None: 10517 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10518 if obj.cpu_profile is not None: 10519 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 10520 if obj.disk_attachments is not None: 10521 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 10522 if obj.dynamic_cpu is not None: 10523 DynamicCpuWriter.write_one(obj.dynamic_cpu, writer, 'dynamic_cpu') 10524 if obj.external_host_provider is not None: 10525 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 10526 if obj.floppies is not None: 10527 FloppyWriter.write_many(obj.floppies, writer, 'floppy', 'floppies') 10528 if obj.graphics_consoles is not None: 10529 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 10530 if obj.host is not None: 10531 HostWriter.write_one(obj.host, writer, 'host') 10532 if obj.host_devices is not None: 10533 HostDeviceWriter.write_many(obj.host_devices, writer, 'host_device', 'host_devices') 10534 if obj.instance_type is not None: 10535 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10536 if obj.katello_errata is not None: 10537 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 10538 if obj.mediated_devices is not None: 10539 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 10540 if obj.nics is not None: 10541 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 10542 if obj.numa_nodes is not None: 10543 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 10544 if obj.original_template is not None: 10545 TemplateWriter.write_one(obj.original_template, writer, 'original_template') 10546 if obj.permissions is not None: 10547 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10548 if obj.quota is not None: 10549 QuotaWriter.write_one(obj.quota, writer, 'quota') 10550 if obj.reported_devices is not None: 10551 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 10552 if obj.sessions is not None: 10553 SessionWriter.write_many(obj.sessions, writer, 'session', 'sessions') 10554 if obj.snapshots is not None: 10555 SnapshotWriter.write_many(obj.snapshots, writer, 'snapshot', 'snapshots') 10556 if obj.statistics is not None: 10557 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 10558 if obj.storage_domain is not None: 10559 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 10560 if obj.tags is not None: 10561 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 10562 if obj.template is not None: 10563 TemplateWriter.write_one(obj.template, writer, 'template') 10564 if obj.vm_pool is not None: 10565 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 10566 if obj.watchdogs is not None: 10567 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 10568 writer.write_end() 10569 10570 @staticmethod 10571 def write_many(objs, writer, singular=None, plural=None): 10572 if singular is None: 10573 singular = 'vm' 10574 if plural is None: 10575 plural = 'vms' 10576 writer.write_start(plural) 10577 if isinstance(objs, List): 10578 href = objs.href 10579 if href is not None: 10580 writer.write_attribute('href', href) 10581 for obj in objs: 10582 VmWriter.write_one(obj, writer, singular) 10583 writer.write_end() 10584 10585 10586class VmBaseWriter(Writer): 10587 10588 def __init__(self): 10589 super(VmBaseWriter, self).__init__() 10590 10591 @staticmethod 10592 def write_one(obj, writer, singular=None): 10593 if singular is None: 10594 singular = 'vm_base' 10595 writer.write_start(singular) 10596 href = obj.href 10597 if href is not None: 10598 writer.write_attribute('href', href) 10599 if obj.id is not None: 10600 writer.write_attribute('id', obj.id) 10601 if obj.auto_pinning_policy is not None: 10602 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 10603 if obj.bios is not None: 10604 BiosWriter.write_one(obj.bios, writer, 'bios') 10605 if obj.comment is not None: 10606 Writer.write_string(writer, 'comment', obj.comment) 10607 if obj.console is not None: 10608 ConsoleWriter.write_one(obj.console, writer, 'console') 10609 if obj.cpu is not None: 10610 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10611 if obj.cpu_pinning_policy is not None: 10612 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 10613 if obj.cpu_shares is not None: 10614 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 10615 if obj.creation_time is not None: 10616 Writer.write_date(writer, 'creation_time', obj.creation_time) 10617 if obj.custom_compatibility_version is not None: 10618 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 10619 if obj.custom_cpu_model is not None: 10620 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 10621 if obj.custom_emulated_machine is not None: 10622 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 10623 if obj.custom_properties is not None: 10624 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10625 if obj.delete_protected is not None: 10626 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 10627 if obj.description is not None: 10628 Writer.write_string(writer, 'description', obj.description) 10629 if obj.display is not None: 10630 DisplayWriter.write_one(obj.display, writer, 'display') 10631 if obj.domain is not None: 10632 DomainWriter.write_one(obj.domain, writer, 'domain') 10633 if obj.high_availability is not None: 10634 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 10635 if obj.initialization is not None: 10636 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 10637 if obj.io is not None: 10638 IoWriter.write_one(obj.io, writer, 'io') 10639 if obj.large_icon is not None: 10640 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 10641 if obj.lease is not None: 10642 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 10643 if obj.memory is not None: 10644 Writer.write_integer(writer, 'memory', obj.memory) 10645 if obj.memory_policy is not None: 10646 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 10647 if obj.migration is not None: 10648 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 10649 if obj.migration_downtime is not None: 10650 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 10651 if obj.multi_queues_enabled is not None: 10652 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 10653 if obj.name is not None: 10654 Writer.write_string(writer, 'name', obj.name) 10655 if obj.origin is not None: 10656 Writer.write_string(writer, 'origin', obj.origin) 10657 if obj.os is not None: 10658 OperatingSystemWriter.write_one(obj.os, writer, 'os') 10659 if obj.placement_policy is not None: 10660 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 10661 if obj.rng_device is not None: 10662 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10663 if obj.serial_number is not None: 10664 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 10665 if obj.small_icon is not None: 10666 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 10667 if obj.soundcard_enabled is not None: 10668 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10669 if obj.sso is not None: 10670 SsoWriter.write_one(obj.sso, writer, 'sso') 10671 if obj.start_paused is not None: 10672 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 10673 if obj.stateless is not None: 10674 Writer.write_boolean(writer, 'stateless', obj.stateless) 10675 if obj.storage_error_resume_behaviour is not None: 10676 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 10677 if obj.time_zone is not None: 10678 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 10679 if obj.tpm_enabled is not None: 10680 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10681 if obj.tunnel_migration is not None: 10682 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 10683 if obj.type is not None: 10684 Writer.write_string(writer, 'type', obj.type.value) 10685 if obj.usb is not None: 10686 UsbWriter.write_one(obj.usb, writer, 'usb') 10687 if obj.virtio_scsi is not None: 10688 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 10689 if obj.virtio_scsi_multi_queues is not None: 10690 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 10691 if obj.virtio_scsi_multi_queues_enabled is not None: 10692 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 10693 if obj.cluster is not None: 10694 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10695 if obj.cpu_profile is not None: 10696 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 10697 if obj.quota is not None: 10698 QuotaWriter.write_one(obj.quota, writer, 'quota') 10699 if obj.storage_domain is not None: 10700 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 10701 writer.write_end() 10702 10703 @staticmethod 10704 def write_many(objs, writer, singular=None, plural=None): 10705 if singular is None: 10706 singular = 'vm_base' 10707 if plural is None: 10708 plural = 'vm_bases' 10709 writer.write_start(plural) 10710 if isinstance(objs, List): 10711 href = objs.href 10712 if href is not None: 10713 writer.write_attribute('href', href) 10714 for obj in objs: 10715 VmBaseWriter.write_one(obj, writer, singular) 10716 writer.write_end() 10717 10718 10719class VmMediatedDeviceWriter(Writer): 10720 10721 def __init__(self): 10722 super(VmMediatedDeviceWriter, self).__init__() 10723 10724 @staticmethod 10725 def write_one(obj, writer, singular=None): 10726 if singular is None: 10727 singular = 'vm_mediated_device' 10728 writer.write_start(singular) 10729 href = obj.href 10730 if href is not None: 10731 writer.write_attribute('href', href) 10732 if obj.id is not None: 10733 writer.write_attribute('id', obj.id) 10734 if obj.comment is not None: 10735 Writer.write_string(writer, 'comment', obj.comment) 10736 if obj.description is not None: 10737 Writer.write_string(writer, 'description', obj.description) 10738 if obj.name is not None: 10739 Writer.write_string(writer, 'name', obj.name) 10740 if obj.spec_params is not None: 10741 PropertyWriter.write_many(obj.spec_params, writer, 'property', 'spec_params') 10742 if obj.instance_type is not None: 10743 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10744 if obj.template is not None: 10745 TemplateWriter.write_one(obj.template, writer, 'template') 10746 if obj.vm is not None: 10747 VmWriter.write_one(obj.vm, writer, 'vm') 10748 if obj.vms is not None: 10749 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 10750 writer.write_end() 10751 10752 @staticmethod 10753 def write_many(objs, writer, singular=None, plural=None): 10754 if singular is None: 10755 singular = 'vm_mediated_device' 10756 if plural is None: 10757 plural = 'vm_mediated_devices' 10758 writer.write_start(plural) 10759 if isinstance(objs, List): 10760 href = objs.href 10761 if href is not None: 10762 writer.write_attribute('href', href) 10763 for obj in objs: 10764 VmMediatedDeviceWriter.write_one(obj, writer, singular) 10765 writer.write_end() 10766 10767 10768class VmPlacementPolicyWriter(Writer): 10769 10770 def __init__(self): 10771 super(VmPlacementPolicyWriter, self).__init__() 10772 10773 @staticmethod 10774 def write_one(obj, writer, singular=None): 10775 if singular is None: 10776 singular = 'vm_placement_policy' 10777 writer.write_start(singular) 10778 href = obj.href 10779 if href is not None: 10780 writer.write_attribute('href', href) 10781 if obj.affinity is not None: 10782 Writer.write_string(writer, 'affinity', obj.affinity.value) 10783 if obj.hosts is not None: 10784 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 10785 writer.write_end() 10786 10787 @staticmethod 10788 def write_many(objs, writer, singular=None, plural=None): 10789 if singular is None: 10790 singular = 'vm_placement_policy' 10791 if plural is None: 10792 plural = 'vm_placement_policies' 10793 writer.write_start(plural) 10794 if isinstance(objs, List): 10795 href = objs.href 10796 if href is not None: 10797 writer.write_attribute('href', href) 10798 for obj in objs: 10799 VmPlacementPolicyWriter.write_one(obj, writer, singular) 10800 writer.write_end() 10801 10802 10803class VmPoolWriter(Writer): 10804 10805 def __init__(self): 10806 super(VmPoolWriter, self).__init__() 10807 10808 @staticmethod 10809 def write_one(obj, writer, singular=None): 10810 if singular is None: 10811 singular = 'vm_pool' 10812 writer.write_start(singular) 10813 href = obj.href 10814 if href is not None: 10815 writer.write_attribute('href', href) 10816 if obj.id is not None: 10817 writer.write_attribute('id', obj.id) 10818 if obj.auto_storage_select is not None: 10819 Writer.write_boolean(writer, 'auto_storage_select', obj.auto_storage_select) 10820 if obj.comment is not None: 10821 Writer.write_string(writer, 'comment', obj.comment) 10822 if obj.description is not None: 10823 Writer.write_string(writer, 'description', obj.description) 10824 if obj.display is not None: 10825 DisplayWriter.write_one(obj.display, writer, 'display') 10826 if obj.max_user_vms is not None: 10827 Writer.write_integer(writer, 'max_user_vms', obj.max_user_vms) 10828 if obj.name is not None: 10829 Writer.write_string(writer, 'name', obj.name) 10830 if obj.prestarted_vms is not None: 10831 Writer.write_integer(writer, 'prestarted_vms', obj.prestarted_vms) 10832 if obj.rng_device is not None: 10833 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10834 if obj.size is not None: 10835 Writer.write_integer(writer, 'size', obj.size) 10836 if obj.soundcard_enabled is not None: 10837 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10838 if obj.stateful is not None: 10839 Writer.write_boolean(writer, 'stateful', obj.stateful) 10840 if obj.tpm_enabled is not None: 10841 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10842 if obj.type is not None: 10843 Writer.write_string(writer, 'type', obj.type.value) 10844 if obj.use_latest_template_version is not None: 10845 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 10846 if obj.cluster is not None: 10847 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10848 if obj.instance_type is not None: 10849 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10850 if obj.permissions is not None: 10851 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10852 if obj.template is not None: 10853 TemplateWriter.write_one(obj.template, writer, 'template') 10854 if obj.vm is not None: 10855 VmWriter.write_one(obj.vm, writer, 'vm') 10856 writer.write_end() 10857 10858 @staticmethod 10859 def write_many(objs, writer, singular=None, plural=None): 10860 if singular is None: 10861 singular = 'vm_pool' 10862 if plural is None: 10863 plural = 'vm_pools' 10864 writer.write_start(plural) 10865 if isinstance(objs, List): 10866 href = objs.href 10867 if href is not None: 10868 writer.write_attribute('href', href) 10869 for obj in objs: 10870 VmPoolWriter.write_one(obj, writer, singular) 10871 writer.write_end() 10872 10873 10874class VmSummaryWriter(Writer): 10875 10876 def __init__(self): 10877 super(VmSummaryWriter, self).__init__() 10878 10879 @staticmethod 10880 def write_one(obj, writer, singular=None): 10881 if singular is None: 10882 singular = 'vm_summary' 10883 writer.write_start(singular) 10884 href = obj.href 10885 if href is not None: 10886 writer.write_attribute('href', href) 10887 if obj.active is not None: 10888 Writer.write_integer(writer, 'active', obj.active) 10889 if obj.migrating is not None: 10890 Writer.write_integer(writer, 'migrating', obj.migrating) 10891 if obj.total is not None: 10892 Writer.write_integer(writer, 'total', obj.total) 10893 writer.write_end() 10894 10895 @staticmethod 10896 def write_many(objs, writer, singular=None, plural=None): 10897 if singular is None: 10898 singular = 'vm_summary' 10899 if plural is None: 10900 plural = 'vm_summaries' 10901 writer.write_start(plural) 10902 if isinstance(objs, List): 10903 href = objs.href 10904 if href is not None: 10905 writer.write_attribute('href', href) 10906 for obj in objs: 10907 VmSummaryWriter.write_one(obj, writer, singular) 10908 writer.write_end() 10909 10910 10911class VnicPassThroughWriter(Writer): 10912 10913 def __init__(self): 10914 super(VnicPassThroughWriter, self).__init__() 10915 10916 @staticmethod 10917 def write_one(obj, writer, singular=None): 10918 if singular is None: 10919 singular = 'vnic_pass_through' 10920 writer.write_start(singular) 10921 href = obj.href 10922 if href is not None: 10923 writer.write_attribute('href', href) 10924 if obj.mode is not None: 10925 Writer.write_string(writer, 'mode', obj.mode.value) 10926 writer.write_end() 10927 10928 @staticmethod 10929 def write_many(objs, writer, singular=None, plural=None): 10930 if singular is None: 10931 singular = 'vnic_pass_through' 10932 if plural is None: 10933 plural = 'vnic_pass_throughs' 10934 writer.write_start(plural) 10935 if isinstance(objs, List): 10936 href = objs.href 10937 if href is not None: 10938 writer.write_attribute('href', href) 10939 for obj in objs: 10940 VnicPassThroughWriter.write_one(obj, writer, singular) 10941 writer.write_end() 10942 10943 10944class VnicProfileWriter(Writer): 10945 10946 def __init__(self): 10947 super(VnicProfileWriter, self).__init__() 10948 10949 @staticmethod 10950 def write_one(obj, writer, singular=None): 10951 if singular is None: 10952 singular = 'vnic_profile' 10953 writer.write_start(singular) 10954 href = obj.href 10955 if href is not None: 10956 writer.write_attribute('href', href) 10957 if obj.id is not None: 10958 writer.write_attribute('id', obj.id) 10959 if obj.comment is not None: 10960 Writer.write_string(writer, 'comment', obj.comment) 10961 if obj.custom_properties is not None: 10962 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10963 if obj.description is not None: 10964 Writer.write_string(writer, 'description', obj.description) 10965 if obj.migratable is not None: 10966 Writer.write_boolean(writer, 'migratable', obj.migratable) 10967 if obj.name is not None: 10968 Writer.write_string(writer, 'name', obj.name) 10969 if obj.pass_through is not None: 10970 VnicPassThroughWriter.write_one(obj.pass_through, writer, 'pass_through') 10971 if obj.port_mirroring is not None: 10972 Writer.write_boolean(writer, 'port_mirroring', obj.port_mirroring) 10973 if obj.failover is not None: 10974 VnicProfileWriter.write_one(obj.failover, writer, 'failover') 10975 if obj.network is not None: 10976 NetworkWriter.write_one(obj.network, writer, 'network') 10977 if obj.network_filter is not None: 10978 NetworkFilterWriter.write_one(obj.network_filter, writer, 'network_filter') 10979 if obj.permissions is not None: 10980 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10981 if obj.qos is not None: 10982 QosWriter.write_one(obj.qos, writer, 'qos') 10983 writer.write_end() 10984 10985 @staticmethod 10986 def write_many(objs, writer, singular=None, plural=None): 10987 if singular is None: 10988 singular = 'vnic_profile' 10989 if plural is None: 10990 plural = 'vnic_profiles' 10991 writer.write_start(plural) 10992 if isinstance(objs, List): 10993 href = objs.href 10994 if href is not None: 10995 writer.write_attribute('href', href) 10996 for obj in objs: 10997 VnicProfileWriter.write_one(obj, writer, singular) 10998 writer.write_end() 10999 11000 11001class VnicProfileMappingWriter(Writer): 11002 11003 def __init__(self): 11004 super(VnicProfileMappingWriter, self).__init__() 11005 11006 @staticmethod 11007 def write_one(obj, writer, singular=None): 11008 if singular is None: 11009 singular = 'vnic_profile_mapping' 11010 writer.write_start(singular) 11011 href = obj.href 11012 if href is not None: 11013 writer.write_attribute('href', href) 11014 if obj.source_network_name is not None: 11015 Writer.write_string(writer, 'source_network_name', obj.source_network_name) 11016 if obj.source_network_profile_name is not None: 11017 Writer.write_string(writer, 'source_network_profile_name', obj.source_network_profile_name) 11018 if obj.target_vnic_profile is not None: 11019 VnicProfileWriter.write_one(obj.target_vnic_profile, writer, 'target_vnic_profile') 11020 writer.write_end() 11021 11022 @staticmethod 11023 def write_many(objs, writer, singular=None, plural=None): 11024 if singular is None: 11025 singular = 'vnic_profile_mapping' 11026 if plural is None: 11027 plural = 'vnic_profile_mappings' 11028 writer.write_start(plural) 11029 if isinstance(objs, List): 11030 href = objs.href 11031 if href is not None: 11032 writer.write_attribute('href', href) 11033 for obj in objs: 11034 VnicProfileMappingWriter.write_one(obj, writer, singular) 11035 writer.write_end() 11036 11037 11038class VolumeGroupWriter(Writer): 11039 11040 def __init__(self): 11041 super(VolumeGroupWriter, self).__init__() 11042 11043 @staticmethod 11044 def write_one(obj, writer, singular=None): 11045 if singular is None: 11046 singular = 'volume_group' 11047 writer.write_start(singular) 11048 href = obj.href 11049 if href is not None: 11050 writer.write_attribute('href', href) 11051 if obj.id is not None: 11052 writer.write_attribute('id', obj.id) 11053 if obj.logical_units is not None: 11054 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 11055 if obj.name is not None: 11056 Writer.write_string(writer, 'name', obj.name) 11057 writer.write_end() 11058 11059 @staticmethod 11060 def write_many(objs, writer, singular=None, plural=None): 11061 if singular is None: 11062 singular = 'volume_group' 11063 if plural is None: 11064 plural = 'volume_groups' 11065 writer.write_start(plural) 11066 if isinstance(objs, List): 11067 href = objs.href 11068 if href is not None: 11069 writer.write_attribute('href', href) 11070 for obj in objs: 11071 VolumeGroupWriter.write_one(obj, writer, singular) 11072 writer.write_end() 11073 11074 11075class WatchdogWriter(Writer): 11076 11077 def __init__(self): 11078 super(WatchdogWriter, self).__init__() 11079 11080 @staticmethod 11081 def write_one(obj, writer, singular=None): 11082 if singular is None: 11083 singular = 'watchdog' 11084 writer.write_start(singular) 11085 href = obj.href 11086 if href is not None: 11087 writer.write_attribute('href', href) 11088 if obj.id is not None: 11089 writer.write_attribute('id', obj.id) 11090 if obj.action is not None: 11091 Writer.write_string(writer, 'action', obj.action.value) 11092 if obj.comment is not None: 11093 Writer.write_string(writer, 'comment', obj.comment) 11094 if obj.description is not None: 11095 Writer.write_string(writer, 'description', obj.description) 11096 if obj.model is not None: 11097 Writer.write_string(writer, 'model', obj.model.value) 11098 if obj.name is not None: 11099 Writer.write_string(writer, 'name', obj.name) 11100 if obj.instance_type is not None: 11101 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 11102 if obj.template is not None: 11103 TemplateWriter.write_one(obj.template, writer, 'template') 11104 if obj.vm is not None: 11105 VmWriter.write_one(obj.vm, writer, 'vm') 11106 if obj.vms is not None: 11107 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 11108 writer.write_end() 11109 11110 @staticmethod 11111 def write_many(objs, writer, singular=None, plural=None): 11112 if singular is None: 11113 singular = 'watchdog' 11114 if plural is None: 11115 plural = 'watchdogs' 11116 writer.write_start(plural) 11117 if isinstance(objs, List): 11118 href = objs.href 11119 if href is not None: 11120 writer.write_attribute('href', href) 11121 for obj in objs: 11122 WatchdogWriter.write_one(obj, writer, singular) 11123 writer.write_end() 11124 11125 11126class WeightWriter(Writer): 11127 11128 def __init__(self): 11129 super(WeightWriter, self).__init__() 11130 11131 @staticmethod 11132 def write_one(obj, writer, singular=None): 11133 if singular is None: 11134 singular = 'weight' 11135 writer.write_start(singular) 11136 href = obj.href 11137 if href is not None: 11138 writer.write_attribute('href', href) 11139 if obj.id is not None: 11140 writer.write_attribute('id', obj.id) 11141 if obj.comment is not None: 11142 Writer.write_string(writer, 'comment', obj.comment) 11143 if obj.description is not None: 11144 Writer.write_string(writer, 'description', obj.description) 11145 if obj.factor is not None: 11146 Writer.write_integer(writer, 'factor', obj.factor) 11147 if obj.name is not None: 11148 Writer.write_string(writer, 'name', obj.name) 11149 if obj.scheduling_policy is not None: 11150 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 11151 if obj.scheduling_policy_unit is not None: 11152 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 11153 writer.write_end() 11154 11155 @staticmethod 11156 def write_many(objs, writer, singular=None, plural=None): 11157 if singular is None: 11158 singular = 'weight' 11159 if plural is None: 11160 plural = 'weights' 11161 writer.write_start(plural) 11162 if isinstance(objs, List): 11163 href = objs.href 11164 if href is not None: 11165 writer.write_attribute('href', href) 11166 for obj in objs: 11167 WeightWriter.write_one(obj, writer, singular) 11168 writer.write_end() 11169 11170 11171Writer.register(types.Action, ActionWriter.write_one) 11172Writer.register(types.AffinityGroup, AffinityGroupWriter.write_one) 11173Writer.register(types.AffinityLabel, AffinityLabelWriter.write_one) 11174Writer.register(types.AffinityRule, AffinityRuleWriter.write_one) 11175Writer.register(types.Agent, AgentWriter.write_one) 11176Writer.register(types.AgentConfiguration, AgentConfigurationWriter.write_one) 11177Writer.register(types.Api, ApiWriter.write_one) 11178Writer.register(types.ApiSummary, ApiSummaryWriter.write_one) 11179Writer.register(types.ApiSummaryItem, ApiSummaryItemWriter.write_one) 11180Writer.register(types.Application, ApplicationWriter.write_one) 11181Writer.register(types.AuthorizedKey, AuthorizedKeyWriter.write_one) 11182Writer.register(types.Backup, BackupWriter.write_one) 11183Writer.register(types.Balance, BalanceWriter.write_one) 11184Writer.register(types.Bios, BiosWriter.write_one) 11185Writer.register(types.BlockStatistic, BlockStatisticWriter.write_one) 11186Writer.register(types.Bonding, BondingWriter.write_one) 11187Writer.register(types.Bookmark, BookmarkWriter.write_one) 11188Writer.register(types.Boot, BootWriter.write_one) 11189Writer.register(types.BootMenu, BootMenuWriter.write_one) 11190Writer.register(types.BrickProfileDetail, BrickProfileDetailWriter.write_one) 11191Writer.register(types.Cdrom, CdromWriter.write_one) 11192Writer.register(types.Certificate, CertificateWriter.write_one) 11193Writer.register(types.Checkpoint, CheckpointWriter.write_one) 11194Writer.register(types.CloudInit, CloudInitWriter.write_one) 11195Writer.register(types.Cluster, ClusterWriter.write_one) 11196Writer.register(types.ClusterFeature, ClusterFeatureWriter.write_one) 11197Writer.register(types.ClusterLevel, ClusterLevelWriter.write_one) 11198Writer.register(types.Configuration, ConfigurationWriter.write_one) 11199Writer.register(types.Console, ConsoleWriter.write_one) 11200Writer.register(types.Core, CoreWriter.write_one) 11201Writer.register(types.Cpu, CpuWriter.write_one) 11202Writer.register(types.CpuProfile, CpuProfileWriter.write_one) 11203Writer.register(types.CpuTopology, CpuTopologyWriter.write_one) 11204Writer.register(types.CpuTune, CpuTuneWriter.write_one) 11205Writer.register(types.CpuType, CpuTypeWriter.write_one) 11206Writer.register(types.CustomProperty, CustomPropertyWriter.write_one) 11207Writer.register(types.DataCenter, DataCenterWriter.write_one) 11208Writer.register(types.Device, DeviceWriter.write_one) 11209Writer.register(types.Disk, DiskWriter.write_one) 11210Writer.register(types.DiskAttachment, DiskAttachmentWriter.write_one) 11211Writer.register(types.DiskProfile, DiskProfileWriter.write_one) 11212Writer.register(types.DiskSnapshot, DiskSnapshotWriter.write_one) 11213Writer.register(types.Display, DisplayWriter.write_one) 11214Writer.register(types.Dns, DnsWriter.write_one) 11215Writer.register(types.DnsResolverConfiguration, DnsResolverConfigurationWriter.write_one) 11216Writer.register(types.Domain, DomainWriter.write_one) 11217Writer.register(types.DynamicCpu, DynamicCpuWriter.write_one) 11218Writer.register(types.EngineBackupInfo, EngineBackupInfoWriter.write_one) 11219Writer.register(types.EntityProfileDetail, EntityProfileDetailWriter.write_one) 11220Writer.register(types.ErrorHandling, ErrorHandlingWriter.write_one) 11221Writer.register(types.Event, EventWriter.write_one) 11222Writer.register(types.EventSubscription, EventSubscriptionWriter.write_one) 11223Writer.register(types.ExternalComputeResource, ExternalComputeResourceWriter.write_one) 11224Writer.register(types.ExternalDiscoveredHost, ExternalDiscoveredHostWriter.write_one) 11225Writer.register(types.ExternalHost, ExternalHostWriter.write_one) 11226Writer.register(types.ExternalHostGroup, ExternalHostGroupWriter.write_one) 11227Writer.register(types.ExternalHostProvider, ExternalHostProviderWriter.write_one) 11228Writer.register(types.ExternalNetworkProviderConfiguration, ExternalNetworkProviderConfigurationWriter.write_one) 11229Writer.register(types.ExternalProvider, ExternalProviderWriter.write_one) 11230Writer.register(types.ExternalTemplateImport, ExternalTemplateImportWriter.write_one) 11231Writer.register(types.ExternalVmImport, ExternalVmImportWriter.write_one) 11232Writer.register(types.Fault, FaultWriter.write_one) 11233Writer.register(types.FencingPolicy, FencingPolicyWriter.write_one) 11234Writer.register(types.File, FileWriter.write_one) 11235Writer.register(types.Filter, FilterWriter.write_one) 11236Writer.register(types.Floppy, FloppyWriter.write_one) 11237Writer.register(types.FopStatistic, FopStatisticWriter.write_one) 11238Writer.register(types.GlusterBrick, GlusterBrickWriter.write_one) 11239Writer.register(types.GlusterBrickAdvancedDetails, GlusterBrickAdvancedDetailsWriter.write_one) 11240Writer.register(types.GlusterBrickMemoryInfo, GlusterBrickMemoryInfoWriter.write_one) 11241Writer.register(types.GlusterClient, GlusterClientWriter.write_one) 11242Writer.register(types.GlusterHook, GlusterHookWriter.write_one) 11243Writer.register(types.GlusterMemoryPool, GlusterMemoryPoolWriter.write_one) 11244Writer.register(types.GlusterServerHook, GlusterServerHookWriter.write_one) 11245Writer.register(types.GlusterVolume, GlusterVolumeWriter.write_one) 11246Writer.register(types.GlusterVolumeProfileDetails, GlusterVolumeProfileDetailsWriter.write_one) 11247Writer.register(types.GracePeriod, GracePeriodWriter.write_one) 11248Writer.register(types.GraphicsConsole, GraphicsConsoleWriter.write_one) 11249Writer.register(types.Group, GroupWriter.write_one) 11250Writer.register(types.GuestOperatingSystem, GuestOperatingSystemWriter.write_one) 11251Writer.register(types.HardwareInformation, HardwareInformationWriter.write_one) 11252Writer.register(types.HighAvailability, HighAvailabilityWriter.write_one) 11253Writer.register(types.Hook, HookWriter.write_one) 11254Writer.register(types.Host, HostWriter.write_one) 11255Writer.register(types.HostCpuUnit, HostCpuUnitWriter.write_one) 11256Writer.register(types.HostDevice, HostDeviceWriter.write_one) 11257Writer.register(types.HostDevicePassthrough, HostDevicePassthroughWriter.write_one) 11258Writer.register(types.HostNic, HostNicWriter.write_one) 11259Writer.register(types.HostNicVirtualFunctionsConfiguration, HostNicVirtualFunctionsConfigurationWriter.write_one) 11260Writer.register(types.HostStorage, HostStorageWriter.write_one) 11261Writer.register(types.HostedEngine, HostedEngineWriter.write_one) 11262Writer.register(types.Icon, IconWriter.write_one) 11263Writer.register(types.Identified, IdentifiedWriter.write_one) 11264Writer.register(types.Image, ImageWriter.write_one) 11265Writer.register(types.ImageTransfer, ImageTransferWriter.write_one) 11266Writer.register(types.Initialization, InitializationWriter.write_one) 11267Writer.register(types.InstanceType, InstanceTypeWriter.write_one) 11268Writer.register(types.Io, IoWriter.write_one) 11269Writer.register(types.Ip, IpWriter.write_one) 11270Writer.register(types.IpAddressAssignment, IpAddressAssignmentWriter.write_one) 11271Writer.register(types.IscsiBond, IscsiBondWriter.write_one) 11272Writer.register(types.IscsiDetails, IscsiDetailsWriter.write_one) 11273Writer.register(types.Job, JobWriter.write_one) 11274Writer.register(types.KatelloErratum, KatelloErratumWriter.write_one) 11275Writer.register(types.Kernel, KernelWriter.write_one) 11276Writer.register(types.Ksm, KsmWriter.write_one) 11277Writer.register(types.LinkLayerDiscoveryProtocolElement, LinkLayerDiscoveryProtocolElementWriter.write_one) 11278Writer.register(types.LogicalUnit, LogicalUnitWriter.write_one) 11279Writer.register(types.MDevType, MDevTypeWriter.write_one) 11280Writer.register(types.Mac, MacWriter.write_one) 11281Writer.register(types.MacPool, MacPoolWriter.write_one) 11282Writer.register(types.MemoryOverCommit, MemoryOverCommitWriter.write_one) 11283Writer.register(types.MemoryPolicy, MemoryPolicyWriter.write_one) 11284Writer.register(types.Method, MethodWriter.write_one) 11285Writer.register(types.MigrationBandwidth, MigrationBandwidthWriter.write_one) 11286Writer.register(types.MigrationOptions, MigrationOptionsWriter.write_one) 11287Writer.register(types.MigrationPolicy, MigrationPolicyWriter.write_one) 11288Writer.register(types.Network, NetworkWriter.write_one) 11289Writer.register(types.NetworkAttachment, NetworkAttachmentWriter.write_one) 11290Writer.register(types.NetworkConfiguration, NetworkConfigurationWriter.write_one) 11291Writer.register(types.NetworkFilter, NetworkFilterWriter.write_one) 11292Writer.register(types.NetworkFilterParameter, NetworkFilterParameterWriter.write_one) 11293Writer.register(types.NetworkLabel, NetworkLabelWriter.write_one) 11294Writer.register(types.NfsProfileDetail, NfsProfileDetailWriter.write_one) 11295Writer.register(types.Nic, NicWriter.write_one) 11296Writer.register(types.NicConfiguration, NicConfigurationWriter.write_one) 11297Writer.register(types.NumaNode, NumaNodeWriter.write_one) 11298Writer.register(types.NumaNodePin, NumaNodePinWriter.write_one) 11299Writer.register(types.OpenStackImage, OpenStackImageWriter.write_one) 11300Writer.register(types.OpenStackImageProvider, OpenStackImageProviderWriter.write_one) 11301Writer.register(types.OpenStackNetwork, OpenStackNetworkWriter.write_one) 11302Writer.register(types.OpenStackNetworkProvider, OpenStackNetworkProviderWriter.write_one) 11303Writer.register(types.OpenStackProvider, OpenStackProviderWriter.write_one) 11304Writer.register(types.OpenStackSubnet, OpenStackSubnetWriter.write_one) 11305Writer.register(types.OpenStackVolumeProvider, OpenStackVolumeProviderWriter.write_one) 11306Writer.register(types.OpenStackVolumeType, OpenStackVolumeTypeWriter.write_one) 11307Writer.register(types.OpenstackVolumeAuthenticationKey, OpenstackVolumeAuthenticationKeyWriter.write_one) 11308Writer.register(types.OperatingSystem, OperatingSystemWriter.write_one) 11309Writer.register(types.OperatingSystemInfo, OperatingSystemInfoWriter.write_one) 11310Writer.register(types.Option, OptionWriter.write_one) 11311Writer.register(types.Package, PackageWriter.write_one) 11312Writer.register(types.Payload, PayloadWriter.write_one) 11313Writer.register(types.Permission, PermissionWriter.write_one) 11314Writer.register(types.Permit, PermitWriter.write_one) 11315Writer.register(types.PmProxy, PmProxyWriter.write_one) 11316Writer.register(types.PortMirroring, PortMirroringWriter.write_one) 11317Writer.register(types.PowerManagement, PowerManagementWriter.write_one) 11318Writer.register(types.Product, ProductWriter.write_one) 11319Writer.register(types.ProductInfo, ProductInfoWriter.write_one) 11320Writer.register(types.ProfileDetail, ProfileDetailWriter.write_one) 11321Writer.register(types.Property, PropertyWriter.write_one) 11322Writer.register(types.ProxyTicket, ProxyTicketWriter.write_one) 11323Writer.register(types.Qos, QosWriter.write_one) 11324Writer.register(types.Quota, QuotaWriter.write_one) 11325Writer.register(types.QuotaClusterLimit, QuotaClusterLimitWriter.write_one) 11326Writer.register(types.QuotaStorageLimit, QuotaStorageLimitWriter.write_one) 11327Writer.register(types.Range, RangeWriter.write_one) 11328Writer.register(types.Rate, RateWriter.write_one) 11329Writer.register(types.RegistrationAffinityGroupMapping, RegistrationAffinityGroupMappingWriter.write_one) 11330Writer.register(types.RegistrationAffinityLabelMapping, RegistrationAffinityLabelMappingWriter.write_one) 11331Writer.register(types.RegistrationClusterMapping, RegistrationClusterMappingWriter.write_one) 11332Writer.register(types.RegistrationConfiguration, RegistrationConfigurationWriter.write_one) 11333Writer.register(types.RegistrationDomainMapping, RegistrationDomainMappingWriter.write_one) 11334Writer.register(types.RegistrationLunMapping, RegistrationLunMappingWriter.write_one) 11335Writer.register(types.RegistrationRoleMapping, RegistrationRoleMappingWriter.write_one) 11336Writer.register(types.RegistrationVnicProfileMapping, RegistrationVnicProfileMappingWriter.write_one) 11337Writer.register(types.ReportedConfiguration, ReportedConfigurationWriter.write_one) 11338Writer.register(types.ReportedDevice, ReportedDeviceWriter.write_one) 11339Writer.register(types.RngDevice, RngDeviceWriter.write_one) 11340Writer.register(types.Role, RoleWriter.write_one) 11341Writer.register(types.SchedulingPolicy, SchedulingPolicyWriter.write_one) 11342Writer.register(types.SchedulingPolicyUnit, SchedulingPolicyUnitWriter.write_one) 11343Writer.register(types.SeLinux, SeLinuxWriter.write_one) 11344Writer.register(types.SerialNumber, SerialNumberWriter.write_one) 11345Writer.register(types.Session, SessionWriter.write_one) 11346Writer.register(types.SkipIfConnectivityBroken, SkipIfConnectivityBrokenWriter.write_one) 11347Writer.register(types.SkipIfSdActive, SkipIfSdActiveWriter.write_one) 11348Writer.register(types.Snapshot, SnapshotWriter.write_one) 11349Writer.register(types.SpecialObjects, SpecialObjectsWriter.write_one) 11350Writer.register(types.Spm, SpmWriter.write_one) 11351Writer.register(types.Ssh, SshWriter.write_one) 11352Writer.register(types.SshPublicKey, SshPublicKeyWriter.write_one) 11353Writer.register(types.Sso, SsoWriter.write_one) 11354Writer.register(types.Statistic, StatisticWriter.write_one) 11355Writer.register(types.Step, StepWriter.write_one) 11356Writer.register(types.StorageConnection, StorageConnectionWriter.write_one) 11357Writer.register(types.StorageConnectionExtension, StorageConnectionExtensionWriter.write_one) 11358Writer.register(types.StorageDomain, StorageDomainWriter.write_one) 11359Writer.register(types.StorageDomainLease, StorageDomainLeaseWriter.write_one) 11360Writer.register(types.SystemOption, SystemOptionWriter.write_one) 11361Writer.register(types.SystemOptionValue, SystemOptionValueWriter.write_one) 11362Writer.register(types.Tag, TagWriter.write_one) 11363Writer.register(types.Template, TemplateWriter.write_one) 11364Writer.register(types.TemplateVersion, TemplateVersionWriter.write_one) 11365Writer.register(types.Ticket, TicketWriter.write_one) 11366Writer.register(types.TimeZone, TimeZoneWriter.write_one) 11367Writer.register(types.TransparentHugePages, TransparentHugePagesWriter.write_one) 11368Writer.register(types.UnmanagedNetwork, UnmanagedNetworkWriter.write_one) 11369Writer.register(types.Usb, UsbWriter.write_one) 11370Writer.register(types.User, UserWriter.write_one) 11371Writer.register(types.UserOption, UserOptionWriter.write_one) 11372Writer.register(types.Value, ValueWriter.write_one) 11373Writer.register(types.VcpuPin, VcpuPinWriter.write_one) 11374Writer.register(types.Vendor, VendorWriter.write_one) 11375Writer.register(types.Version, VersionWriter.write_one) 11376Writer.register(types.VirtioScsi, VirtioScsiWriter.write_one) 11377Writer.register(types.VirtualNumaNode, VirtualNumaNodeWriter.write_one) 11378Writer.register(types.Vlan, VlanWriter.write_one) 11379Writer.register(types.Vm, VmWriter.write_one) 11380Writer.register(types.VmBase, VmBaseWriter.write_one) 11381Writer.register(types.VmMediatedDevice, VmMediatedDeviceWriter.write_one) 11382Writer.register(types.VmPlacementPolicy, VmPlacementPolicyWriter.write_one) 11383Writer.register(types.VmPool, VmPoolWriter.write_one) 11384Writer.register(types.VmSummary, VmSummaryWriter.write_one) 11385Writer.register(types.VnicPassThrough, VnicPassThroughWriter.write_one) 11386Writer.register(types.VnicProfile, VnicProfileWriter.write_one) 11387Writer.register(types.VnicProfileMapping, VnicProfileMappingWriter.write_one) 11388Writer.register(types.VolumeGroup, VolumeGroupWriter.write_one) 11389Writer.register(types.Watchdog, WatchdogWriter.write_one) 11390Writer.register(types.Weight, WeightWriter.write_one)
26class ActionWriter(Writer): 27 28 def __init__(self): 29 super(ActionWriter, self).__init__() 30 31 @staticmethod 32 def write_one(obj, writer, singular=None): 33 if singular is None: 34 singular = 'action' 35 writer.write_start(singular) 36 href = obj.href 37 if href is not None: 38 writer.write_attribute('href', href) 39 if obj.id is not None: 40 writer.write_attribute('id', obj.id) 41 if obj.activate is not None: 42 Writer.write_boolean(writer, 'activate', obj.activate) 43 if obj.allow_partial_import is not None: 44 Writer.write_boolean(writer, 'allow_partial_import', obj.allow_partial_import) 45 if obj.async_ is not None: 46 Writer.write_boolean(writer, 'async', obj.async_) 47 if obj.attach_wgt is not None: 48 Writer.write_boolean(writer, 'attach_wgt', obj.attach_wgt) 49 if obj.attachment is not None: 50 DiskAttachmentWriter.write_one(obj.attachment, writer, 'attachment') 51 if obj.authorized_key is not None: 52 AuthorizedKeyWriter.write_one(obj.authorized_key, writer, 'authorized_key') 53 if obj.auto_pinning_policy is not None: 54 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 55 if obj.bricks is not None: 56 GlusterBrickWriter.write_many(obj.bricks, writer, 'brick', 'bricks') 57 if obj.certificates is not None: 58 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 59 if obj.check_connectivity is not None: 60 Writer.write_boolean(writer, 'check_connectivity', obj.check_connectivity) 61 if obj.clone is not None: 62 Writer.write_boolean(writer, 'clone', obj.clone) 63 if obj.clone_permissions is not None: 64 Writer.write_boolean(writer, 'clone_permissions', obj.clone_permissions) 65 if obj.cluster is not None: 66 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 67 if obj.collapse_snapshots is not None: 68 Writer.write_boolean(writer, 'collapse_snapshots', obj.collapse_snapshots) 69 if obj.comment is not None: 70 Writer.write_string(writer, 'comment', obj.comment) 71 if obj.commit_on_success is not None: 72 Writer.write_boolean(writer, 'commit_on_success', obj.commit_on_success) 73 if obj.connection is not None: 74 StorageConnectionWriter.write_one(obj.connection, writer, 'connection') 75 if obj.connectivity_timeout is not None: 76 Writer.write_integer(writer, 'connectivity_timeout', obj.connectivity_timeout) 77 if obj.correlation_id is not None: 78 Writer.write_string(writer, 'correlation_id', obj.correlation_id) 79 if obj.data_center is not None: 80 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 81 if obj.deploy_hosted_engine is not None: 82 Writer.write_boolean(writer, 'deploy_hosted_engine', obj.deploy_hosted_engine) 83 if obj.description is not None: 84 Writer.write_string(writer, 'description', obj.description) 85 if obj.details is not None: 86 GlusterVolumeProfileDetailsWriter.write_one(obj.details, writer, 'details') 87 if obj.directory is not None: 88 Writer.write_string(writer, 'directory', obj.directory) 89 if obj.discard_snapshots is not None: 90 Writer.write_boolean(writer, 'discard_snapshots', obj.discard_snapshots) 91 if obj.discovered_targets is not None: 92 IscsiDetailsWriter.write_many(obj.discovered_targets, writer, 'iscsi_details', 'discovered_targets') 93 if obj.disk is not None: 94 DiskWriter.write_one(obj.disk, writer, 'disk') 95 if obj.disk_profile is not None: 96 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 97 if obj.disks is not None: 98 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 99 if obj.exclusive is not None: 100 Writer.write_boolean(writer, 'exclusive', obj.exclusive) 101 if obj.fault is not None: 102 FaultWriter.write_one(obj.fault, writer, 'fault') 103 if obj.fence_type is not None: 104 Writer.write_string(writer, 'fence_type', obj.fence_type) 105 if obj.filename is not None: 106 Writer.write_string(writer, 'filename', obj.filename) 107 if obj.filter is not None: 108 Writer.write_boolean(writer, 'filter', obj.filter) 109 if obj.fix_layout is not None: 110 Writer.write_boolean(writer, 'fix_layout', obj.fix_layout) 111 if obj.follow is not None: 112 Writer.write_string(writer, 'follow', obj.follow) 113 if obj.force is not None: 114 Writer.write_boolean(writer, 'force', obj.force) 115 if obj.grace_period is not None: 116 GracePeriodWriter.write_one(obj.grace_period, writer, 'grace_period') 117 if obj.host is not None: 118 HostWriter.write_one(obj.host, writer, 'host') 119 if obj.image is not None: 120 Writer.write_string(writer, 'image', obj.image) 121 if obj.image_transfer is not None: 122 ImageTransferWriter.write_one(obj.image_transfer, writer, 'image_transfer') 123 if obj.import_as_template is not None: 124 Writer.write_boolean(writer, 'import_as_template', obj.import_as_template) 125 if obj.is_attached is not None: 126 Writer.write_boolean(writer, 'is_attached', obj.is_attached) 127 if obj.iscsi is not None: 128 IscsiDetailsWriter.write_one(obj.iscsi, writer, 'iscsi') 129 if obj.iscsi_targets is not None: 130 writer.write_start('iscsi_targets') 131 for item in obj.iscsi_targets: 132 if item is not None: 133 Writer.write_string(writer, 'iscsi_target', item) 134 writer.write_end() 135 if obj.job is not None: 136 JobWriter.write_one(obj.job, writer, 'job') 137 if obj.lease is not None: 138 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 139 if obj.logical_units is not None: 140 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 141 if obj.maintenance_after_restart is not None: 142 Writer.write_boolean(writer, 'maintenance_after_restart', obj.maintenance_after_restart) 143 if obj.maintenance_enabled is not None: 144 Writer.write_boolean(writer, 'maintenance_enabled', obj.maintenance_enabled) 145 if obj.migrate_vms_in_affinity_closure is not None: 146 Writer.write_boolean(writer, 'migrate_vms_in_affinity_closure', obj.migrate_vms_in_affinity_closure) 147 if obj.modified_bonds is not None: 148 HostNicWriter.write_many(obj.modified_bonds, writer, 'host_nic', 'modified_bonds') 149 if obj.modified_labels is not None: 150 NetworkLabelWriter.write_many(obj.modified_labels, writer, 'network_label', 'modified_labels') 151 if obj.modified_network_attachments is not None: 152 NetworkAttachmentWriter.write_many(obj.modified_network_attachments, writer, 'network_attachment', 'modified_network_attachments') 153 if obj.name is not None: 154 Writer.write_string(writer, 'name', obj.name) 155 if obj.optimize_cpu_settings is not None: 156 Writer.write_boolean(writer, 'optimize_cpu_settings', obj.optimize_cpu_settings) 157 if obj.option is not None: 158 OptionWriter.write_one(obj.option, writer, 'option') 159 if obj.pause is not None: 160 Writer.write_boolean(writer, 'pause', obj.pause) 161 if obj.permission is not None: 162 PermissionWriter.write_one(obj.permission, writer, 'permission') 163 if obj.power_management is not None: 164 PowerManagementWriter.write_one(obj.power_management, writer, 'power_management') 165 if obj.proxy_ticket is not None: 166 ProxyTicketWriter.write_one(obj.proxy_ticket, writer, 'proxy_ticket') 167 if obj.quota is not None: 168 QuotaWriter.write_one(obj.quota, writer, 'quota') 169 if obj.reason is not None: 170 Writer.write_string(writer, 'reason', obj.reason) 171 if obj.reassign_bad_macs is not None: 172 Writer.write_boolean(writer, 'reassign_bad_macs', obj.reassign_bad_macs) 173 if obj.reboot is not None: 174 Writer.write_boolean(writer, 'reboot', obj.reboot) 175 if obj.registration_configuration is not None: 176 RegistrationConfigurationWriter.write_one(obj.registration_configuration, writer, 'registration_configuration') 177 if obj.remote_viewer_connection_file is not None: 178 Writer.write_string(writer, 'remote_viewer_connection_file', obj.remote_viewer_connection_file) 179 if obj.removed_bonds is not None: 180 HostNicWriter.write_many(obj.removed_bonds, writer, 'host_nic', 'removed_bonds') 181 if obj.removed_labels is not None: 182 NetworkLabelWriter.write_many(obj.removed_labels, writer, 'network_label', 'removed_labels') 183 if obj.removed_network_attachments is not None: 184 NetworkAttachmentWriter.write_many(obj.removed_network_attachments, writer, 'network_attachment', 'removed_network_attachments') 185 if obj.resolution_type is not None: 186 Writer.write_string(writer, 'resolution_type', obj.resolution_type) 187 if obj.restore_memory is not None: 188 Writer.write_boolean(writer, 'restore_memory', obj.restore_memory) 189 if obj.root_password is not None: 190 Writer.write_string(writer, 'root_password', obj.root_password) 191 if obj.seal is not None: 192 Writer.write_boolean(writer, 'seal', obj.seal) 193 if obj.snapshot is not None: 194 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 195 if obj.source_host is not None: 196 HostWriter.write_one(obj.source_host, writer, 'source_host') 197 if obj.ssh is not None: 198 SshWriter.write_one(obj.ssh, writer, 'ssh') 199 if obj.status is not None: 200 Writer.write_string(writer, 'status', obj.status) 201 if obj.stop_gluster_service is not None: 202 Writer.write_boolean(writer, 'stop_gluster_service', obj.stop_gluster_service) 203 if obj.storage_domain is not None: 204 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 205 if obj.storage_domains is not None: 206 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 207 if obj.succeeded is not None: 208 Writer.write_boolean(writer, 'succeeded', obj.succeeded) 209 if obj.synchronized_network_attachments is not None: 210 NetworkAttachmentWriter.write_many(obj.synchronized_network_attachments, writer, 'network_attachment', 'synchronized_network_attachments') 211 if obj.template is not None: 212 TemplateWriter.write_one(obj.template, writer, 'template') 213 if obj.ticket is not None: 214 TicketWriter.write_one(obj.ticket, writer, 'ticket') 215 if obj.timeout is not None: 216 Writer.write_integer(writer, 'timeout', obj.timeout) 217 if obj.undeploy_hosted_engine is not None: 218 Writer.write_boolean(writer, 'undeploy_hosted_engine', obj.undeploy_hosted_engine) 219 if obj.upgrade_action is not None: 220 Writer.write_string(writer, 'upgrade_action', obj.upgrade_action.value) 221 if obj.upgrade_percent_complete is not None: 222 Writer.write_integer(writer, 'upgrade_percent_complete', obj.upgrade_percent_complete) 223 if obj.use_cloud_init is not None: 224 Writer.write_boolean(writer, 'use_cloud_init', obj.use_cloud_init) 225 if obj.use_ignition is not None: 226 Writer.write_boolean(writer, 'use_ignition', obj.use_ignition) 227 if obj.use_initialization is not None: 228 Writer.write_boolean(writer, 'use_initialization', obj.use_initialization) 229 if obj.use_sysprep is not None: 230 Writer.write_boolean(writer, 'use_sysprep', obj.use_sysprep) 231 if obj.virtual_functions_configuration is not None: 232 HostNicVirtualFunctionsConfigurationWriter.write_one(obj.virtual_functions_configuration, writer, 'virtual_functions_configuration') 233 if obj.vm is not None: 234 VmWriter.write_one(obj.vm, writer, 'vm') 235 if obj.vnic_profile_mappings is not None: 236 VnicProfileMappingWriter.write_many(obj.vnic_profile_mappings, writer, 'vnic_profile_mapping', 'vnic_profile_mappings') 237 if obj.volatile is not None: 238 Writer.write_boolean(writer, 'volatile', obj.volatile) 239 writer.write_end() 240 241 @staticmethod 242 def write_many(objs, writer, singular=None, plural=None): 243 if singular is None: 244 singular = 'action' 245 if plural is None: 246 plural = 'actions' 247 writer.write_start(plural) 248 if isinstance(objs, List): 249 href = objs.href 250 if href is not None: 251 writer.write_attribute('href', href) 252 for obj in objs: 253 ActionWriter.write_one(obj, writer, singular) 254 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
31 @staticmethod 32 def write_one(obj, writer, singular=None): 33 if singular is None: 34 singular = 'action' 35 writer.write_start(singular) 36 href = obj.href 37 if href is not None: 38 writer.write_attribute('href', href) 39 if obj.id is not None: 40 writer.write_attribute('id', obj.id) 41 if obj.activate is not None: 42 Writer.write_boolean(writer, 'activate', obj.activate) 43 if obj.allow_partial_import is not None: 44 Writer.write_boolean(writer, 'allow_partial_import', obj.allow_partial_import) 45 if obj.async_ is not None: 46 Writer.write_boolean(writer, 'async', obj.async_) 47 if obj.attach_wgt is not None: 48 Writer.write_boolean(writer, 'attach_wgt', obj.attach_wgt) 49 if obj.attachment is not None: 50 DiskAttachmentWriter.write_one(obj.attachment, writer, 'attachment') 51 if obj.authorized_key is not None: 52 AuthorizedKeyWriter.write_one(obj.authorized_key, writer, 'authorized_key') 53 if obj.auto_pinning_policy is not None: 54 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 55 if obj.bricks is not None: 56 GlusterBrickWriter.write_many(obj.bricks, writer, 'brick', 'bricks') 57 if obj.certificates is not None: 58 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 59 if obj.check_connectivity is not None: 60 Writer.write_boolean(writer, 'check_connectivity', obj.check_connectivity) 61 if obj.clone is not None: 62 Writer.write_boolean(writer, 'clone', obj.clone) 63 if obj.clone_permissions is not None: 64 Writer.write_boolean(writer, 'clone_permissions', obj.clone_permissions) 65 if obj.cluster is not None: 66 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 67 if obj.collapse_snapshots is not None: 68 Writer.write_boolean(writer, 'collapse_snapshots', obj.collapse_snapshots) 69 if obj.comment is not None: 70 Writer.write_string(writer, 'comment', obj.comment) 71 if obj.commit_on_success is not None: 72 Writer.write_boolean(writer, 'commit_on_success', obj.commit_on_success) 73 if obj.connection is not None: 74 StorageConnectionWriter.write_one(obj.connection, writer, 'connection') 75 if obj.connectivity_timeout is not None: 76 Writer.write_integer(writer, 'connectivity_timeout', obj.connectivity_timeout) 77 if obj.correlation_id is not None: 78 Writer.write_string(writer, 'correlation_id', obj.correlation_id) 79 if obj.data_center is not None: 80 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 81 if obj.deploy_hosted_engine is not None: 82 Writer.write_boolean(writer, 'deploy_hosted_engine', obj.deploy_hosted_engine) 83 if obj.description is not None: 84 Writer.write_string(writer, 'description', obj.description) 85 if obj.details is not None: 86 GlusterVolumeProfileDetailsWriter.write_one(obj.details, writer, 'details') 87 if obj.directory is not None: 88 Writer.write_string(writer, 'directory', obj.directory) 89 if obj.discard_snapshots is not None: 90 Writer.write_boolean(writer, 'discard_snapshots', obj.discard_snapshots) 91 if obj.discovered_targets is not None: 92 IscsiDetailsWriter.write_many(obj.discovered_targets, writer, 'iscsi_details', 'discovered_targets') 93 if obj.disk is not None: 94 DiskWriter.write_one(obj.disk, writer, 'disk') 95 if obj.disk_profile is not None: 96 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 97 if obj.disks is not None: 98 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 99 if obj.exclusive is not None: 100 Writer.write_boolean(writer, 'exclusive', obj.exclusive) 101 if obj.fault is not None: 102 FaultWriter.write_one(obj.fault, writer, 'fault') 103 if obj.fence_type is not None: 104 Writer.write_string(writer, 'fence_type', obj.fence_type) 105 if obj.filename is not None: 106 Writer.write_string(writer, 'filename', obj.filename) 107 if obj.filter is not None: 108 Writer.write_boolean(writer, 'filter', obj.filter) 109 if obj.fix_layout is not None: 110 Writer.write_boolean(writer, 'fix_layout', obj.fix_layout) 111 if obj.follow is not None: 112 Writer.write_string(writer, 'follow', obj.follow) 113 if obj.force is not None: 114 Writer.write_boolean(writer, 'force', obj.force) 115 if obj.grace_period is not None: 116 GracePeriodWriter.write_one(obj.grace_period, writer, 'grace_period') 117 if obj.host is not None: 118 HostWriter.write_one(obj.host, writer, 'host') 119 if obj.image is not None: 120 Writer.write_string(writer, 'image', obj.image) 121 if obj.image_transfer is not None: 122 ImageTransferWriter.write_one(obj.image_transfer, writer, 'image_transfer') 123 if obj.import_as_template is not None: 124 Writer.write_boolean(writer, 'import_as_template', obj.import_as_template) 125 if obj.is_attached is not None: 126 Writer.write_boolean(writer, 'is_attached', obj.is_attached) 127 if obj.iscsi is not None: 128 IscsiDetailsWriter.write_one(obj.iscsi, writer, 'iscsi') 129 if obj.iscsi_targets is not None: 130 writer.write_start('iscsi_targets') 131 for item in obj.iscsi_targets: 132 if item is not None: 133 Writer.write_string(writer, 'iscsi_target', item) 134 writer.write_end() 135 if obj.job is not None: 136 JobWriter.write_one(obj.job, writer, 'job') 137 if obj.lease is not None: 138 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 139 if obj.logical_units is not None: 140 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 141 if obj.maintenance_after_restart is not None: 142 Writer.write_boolean(writer, 'maintenance_after_restart', obj.maintenance_after_restart) 143 if obj.maintenance_enabled is not None: 144 Writer.write_boolean(writer, 'maintenance_enabled', obj.maintenance_enabled) 145 if obj.migrate_vms_in_affinity_closure is not None: 146 Writer.write_boolean(writer, 'migrate_vms_in_affinity_closure', obj.migrate_vms_in_affinity_closure) 147 if obj.modified_bonds is not None: 148 HostNicWriter.write_many(obj.modified_bonds, writer, 'host_nic', 'modified_bonds') 149 if obj.modified_labels is not None: 150 NetworkLabelWriter.write_many(obj.modified_labels, writer, 'network_label', 'modified_labels') 151 if obj.modified_network_attachments is not None: 152 NetworkAttachmentWriter.write_many(obj.modified_network_attachments, writer, 'network_attachment', 'modified_network_attachments') 153 if obj.name is not None: 154 Writer.write_string(writer, 'name', obj.name) 155 if obj.optimize_cpu_settings is not None: 156 Writer.write_boolean(writer, 'optimize_cpu_settings', obj.optimize_cpu_settings) 157 if obj.option is not None: 158 OptionWriter.write_one(obj.option, writer, 'option') 159 if obj.pause is not None: 160 Writer.write_boolean(writer, 'pause', obj.pause) 161 if obj.permission is not None: 162 PermissionWriter.write_one(obj.permission, writer, 'permission') 163 if obj.power_management is not None: 164 PowerManagementWriter.write_one(obj.power_management, writer, 'power_management') 165 if obj.proxy_ticket is not None: 166 ProxyTicketWriter.write_one(obj.proxy_ticket, writer, 'proxy_ticket') 167 if obj.quota is not None: 168 QuotaWriter.write_one(obj.quota, writer, 'quota') 169 if obj.reason is not None: 170 Writer.write_string(writer, 'reason', obj.reason) 171 if obj.reassign_bad_macs is not None: 172 Writer.write_boolean(writer, 'reassign_bad_macs', obj.reassign_bad_macs) 173 if obj.reboot is not None: 174 Writer.write_boolean(writer, 'reboot', obj.reboot) 175 if obj.registration_configuration is not None: 176 RegistrationConfigurationWriter.write_one(obj.registration_configuration, writer, 'registration_configuration') 177 if obj.remote_viewer_connection_file is not None: 178 Writer.write_string(writer, 'remote_viewer_connection_file', obj.remote_viewer_connection_file) 179 if obj.removed_bonds is not None: 180 HostNicWriter.write_many(obj.removed_bonds, writer, 'host_nic', 'removed_bonds') 181 if obj.removed_labels is not None: 182 NetworkLabelWriter.write_many(obj.removed_labels, writer, 'network_label', 'removed_labels') 183 if obj.removed_network_attachments is not None: 184 NetworkAttachmentWriter.write_many(obj.removed_network_attachments, writer, 'network_attachment', 'removed_network_attachments') 185 if obj.resolution_type is not None: 186 Writer.write_string(writer, 'resolution_type', obj.resolution_type) 187 if obj.restore_memory is not None: 188 Writer.write_boolean(writer, 'restore_memory', obj.restore_memory) 189 if obj.root_password is not None: 190 Writer.write_string(writer, 'root_password', obj.root_password) 191 if obj.seal is not None: 192 Writer.write_boolean(writer, 'seal', obj.seal) 193 if obj.snapshot is not None: 194 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 195 if obj.source_host is not None: 196 HostWriter.write_one(obj.source_host, writer, 'source_host') 197 if obj.ssh is not None: 198 SshWriter.write_one(obj.ssh, writer, 'ssh') 199 if obj.status is not None: 200 Writer.write_string(writer, 'status', obj.status) 201 if obj.stop_gluster_service is not None: 202 Writer.write_boolean(writer, 'stop_gluster_service', obj.stop_gluster_service) 203 if obj.storage_domain is not None: 204 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 205 if obj.storage_domains is not None: 206 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 207 if obj.succeeded is not None: 208 Writer.write_boolean(writer, 'succeeded', obj.succeeded) 209 if obj.synchronized_network_attachments is not None: 210 NetworkAttachmentWriter.write_many(obj.synchronized_network_attachments, writer, 'network_attachment', 'synchronized_network_attachments') 211 if obj.template is not None: 212 TemplateWriter.write_one(obj.template, writer, 'template') 213 if obj.ticket is not None: 214 TicketWriter.write_one(obj.ticket, writer, 'ticket') 215 if obj.timeout is not None: 216 Writer.write_integer(writer, 'timeout', obj.timeout) 217 if obj.undeploy_hosted_engine is not None: 218 Writer.write_boolean(writer, 'undeploy_hosted_engine', obj.undeploy_hosted_engine) 219 if obj.upgrade_action is not None: 220 Writer.write_string(writer, 'upgrade_action', obj.upgrade_action.value) 221 if obj.upgrade_percent_complete is not None: 222 Writer.write_integer(writer, 'upgrade_percent_complete', obj.upgrade_percent_complete) 223 if obj.use_cloud_init is not None: 224 Writer.write_boolean(writer, 'use_cloud_init', obj.use_cloud_init) 225 if obj.use_ignition is not None: 226 Writer.write_boolean(writer, 'use_ignition', obj.use_ignition) 227 if obj.use_initialization is not None: 228 Writer.write_boolean(writer, 'use_initialization', obj.use_initialization) 229 if obj.use_sysprep is not None: 230 Writer.write_boolean(writer, 'use_sysprep', obj.use_sysprep) 231 if obj.virtual_functions_configuration is not None: 232 HostNicVirtualFunctionsConfigurationWriter.write_one(obj.virtual_functions_configuration, writer, 'virtual_functions_configuration') 233 if obj.vm is not None: 234 VmWriter.write_one(obj.vm, writer, 'vm') 235 if obj.vnic_profile_mappings is not None: 236 VnicProfileMappingWriter.write_many(obj.vnic_profile_mappings, writer, 'vnic_profile_mapping', 'vnic_profile_mappings') 237 if obj.volatile is not None: 238 Writer.write_boolean(writer, 'volatile', obj.volatile) 239 writer.write_end()
241 @staticmethod 242 def write_many(objs, writer, singular=None, plural=None): 243 if singular is None: 244 singular = 'action' 245 if plural is None: 246 plural = 'actions' 247 writer.write_start(plural) 248 if isinstance(objs, List): 249 href = objs.href 250 if href is not None: 251 writer.write_attribute('href', href) 252 for obj in objs: 253 ActionWriter.write_one(obj, writer, singular) 254 writer.write_end()
257class AffinityGroupWriter(Writer): 258 259 def __init__(self): 260 super(AffinityGroupWriter, self).__init__() 261 262 @staticmethod 263 def write_one(obj, writer, singular=None): 264 if singular is None: 265 singular = 'affinity_group' 266 writer.write_start(singular) 267 href = obj.href 268 if href is not None: 269 writer.write_attribute('href', href) 270 if obj.id is not None: 271 writer.write_attribute('id', obj.id) 272 if obj.broken is not None: 273 Writer.write_boolean(writer, 'broken', obj.broken) 274 if obj.comment is not None: 275 Writer.write_string(writer, 'comment', obj.comment) 276 if obj.description is not None: 277 Writer.write_string(writer, 'description', obj.description) 278 if obj.enforcing is not None: 279 Writer.write_boolean(writer, 'enforcing', obj.enforcing) 280 if obj.hosts_rule is not None: 281 AffinityRuleWriter.write_one(obj.hosts_rule, writer, 'hosts_rule') 282 if obj.name is not None: 283 Writer.write_string(writer, 'name', obj.name) 284 if obj.positive is not None: 285 Writer.write_boolean(writer, 'positive', obj.positive) 286 if obj.priority is not None: 287 Writer.write_decimal(writer, 'priority', obj.priority) 288 if obj.vms_rule is not None: 289 AffinityRuleWriter.write_one(obj.vms_rule, writer, 'vms_rule') 290 if obj.cluster is not None: 291 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 292 if obj.host_labels is not None: 293 AffinityLabelWriter.write_many(obj.host_labels, writer, 'affinity_label', 'host_labels') 294 if obj.hosts is not None: 295 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 296 if obj.vm_labels is not None: 297 AffinityLabelWriter.write_many(obj.vm_labels, writer, 'affinity_label', 'vm_labels') 298 if obj.vms is not None: 299 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 300 writer.write_end() 301 302 @staticmethod 303 def write_many(objs, writer, singular=None, plural=None): 304 if singular is None: 305 singular = 'affinity_group' 306 if plural is None: 307 plural = 'affinity_groups' 308 writer.write_start(plural) 309 if isinstance(objs, List): 310 href = objs.href 311 if href is not None: 312 writer.write_attribute('href', href) 313 for obj in objs: 314 AffinityGroupWriter.write_one(obj, writer, singular) 315 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
262 @staticmethod 263 def write_one(obj, writer, singular=None): 264 if singular is None: 265 singular = 'affinity_group' 266 writer.write_start(singular) 267 href = obj.href 268 if href is not None: 269 writer.write_attribute('href', href) 270 if obj.id is not None: 271 writer.write_attribute('id', obj.id) 272 if obj.broken is not None: 273 Writer.write_boolean(writer, 'broken', obj.broken) 274 if obj.comment is not None: 275 Writer.write_string(writer, 'comment', obj.comment) 276 if obj.description is not None: 277 Writer.write_string(writer, 'description', obj.description) 278 if obj.enforcing is not None: 279 Writer.write_boolean(writer, 'enforcing', obj.enforcing) 280 if obj.hosts_rule is not None: 281 AffinityRuleWriter.write_one(obj.hosts_rule, writer, 'hosts_rule') 282 if obj.name is not None: 283 Writer.write_string(writer, 'name', obj.name) 284 if obj.positive is not None: 285 Writer.write_boolean(writer, 'positive', obj.positive) 286 if obj.priority is not None: 287 Writer.write_decimal(writer, 'priority', obj.priority) 288 if obj.vms_rule is not None: 289 AffinityRuleWriter.write_one(obj.vms_rule, writer, 'vms_rule') 290 if obj.cluster is not None: 291 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 292 if obj.host_labels is not None: 293 AffinityLabelWriter.write_many(obj.host_labels, writer, 'affinity_label', 'host_labels') 294 if obj.hosts is not None: 295 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 296 if obj.vm_labels is not None: 297 AffinityLabelWriter.write_many(obj.vm_labels, writer, 'affinity_label', 'vm_labels') 298 if obj.vms is not None: 299 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 300 writer.write_end()
302 @staticmethod 303 def write_many(objs, writer, singular=None, plural=None): 304 if singular is None: 305 singular = 'affinity_group' 306 if plural is None: 307 plural = 'affinity_groups' 308 writer.write_start(plural) 309 if isinstance(objs, List): 310 href = objs.href 311 if href is not None: 312 writer.write_attribute('href', href) 313 for obj in objs: 314 AffinityGroupWriter.write_one(obj, writer, singular) 315 writer.write_end()
318class AffinityLabelWriter(Writer): 319 320 def __init__(self): 321 super(AffinityLabelWriter, self).__init__() 322 323 @staticmethod 324 def write_one(obj, writer, singular=None): 325 if singular is None: 326 singular = 'affinity_label' 327 writer.write_start(singular) 328 href = obj.href 329 if href is not None: 330 writer.write_attribute('href', href) 331 if obj.id is not None: 332 writer.write_attribute('id', obj.id) 333 if obj.comment is not None: 334 Writer.write_string(writer, 'comment', obj.comment) 335 if obj.description is not None: 336 Writer.write_string(writer, 'description', obj.description) 337 if obj.has_implicit_affinity_group is not None: 338 Writer.write_boolean(writer, 'has_implicit_affinity_group', obj.has_implicit_affinity_group) 339 if obj.name is not None: 340 Writer.write_string(writer, 'name', obj.name) 341 if obj.read_only is not None: 342 Writer.write_boolean(writer, 'read_only', obj.read_only) 343 if obj.hosts is not None: 344 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 345 if obj.vms is not None: 346 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 347 writer.write_end() 348 349 @staticmethod 350 def write_many(objs, writer, singular=None, plural=None): 351 if singular is None: 352 singular = 'affinity_label' 353 if plural is None: 354 plural = 'affinity_labels' 355 writer.write_start(plural) 356 if isinstance(objs, List): 357 href = objs.href 358 if href is not None: 359 writer.write_attribute('href', href) 360 for obj in objs: 361 AffinityLabelWriter.write_one(obj, writer, singular) 362 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
323 @staticmethod 324 def write_one(obj, writer, singular=None): 325 if singular is None: 326 singular = 'affinity_label' 327 writer.write_start(singular) 328 href = obj.href 329 if href is not None: 330 writer.write_attribute('href', href) 331 if obj.id is not None: 332 writer.write_attribute('id', obj.id) 333 if obj.comment is not None: 334 Writer.write_string(writer, 'comment', obj.comment) 335 if obj.description is not None: 336 Writer.write_string(writer, 'description', obj.description) 337 if obj.has_implicit_affinity_group is not None: 338 Writer.write_boolean(writer, 'has_implicit_affinity_group', obj.has_implicit_affinity_group) 339 if obj.name is not None: 340 Writer.write_string(writer, 'name', obj.name) 341 if obj.read_only is not None: 342 Writer.write_boolean(writer, 'read_only', obj.read_only) 343 if obj.hosts is not None: 344 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 345 if obj.vms is not None: 346 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 347 writer.write_end()
349 @staticmethod 350 def write_many(objs, writer, singular=None, plural=None): 351 if singular is None: 352 singular = 'affinity_label' 353 if plural is None: 354 plural = 'affinity_labels' 355 writer.write_start(plural) 356 if isinstance(objs, List): 357 href = objs.href 358 if href is not None: 359 writer.write_attribute('href', href) 360 for obj in objs: 361 AffinityLabelWriter.write_one(obj, writer, singular) 362 writer.write_end()
365class AffinityRuleWriter(Writer): 366 367 def __init__(self): 368 super(AffinityRuleWriter, self).__init__() 369 370 @staticmethod 371 def write_one(obj, writer, singular=None): 372 if singular is None: 373 singular = 'affinity_rule' 374 writer.write_start(singular) 375 href = obj.href 376 if href is not None: 377 writer.write_attribute('href', href) 378 if obj.enabled is not None: 379 Writer.write_boolean(writer, 'enabled', obj.enabled) 380 if obj.enforcing is not None: 381 Writer.write_boolean(writer, 'enforcing', obj.enforcing) 382 if obj.positive is not None: 383 Writer.write_boolean(writer, 'positive', obj.positive) 384 writer.write_end() 385 386 @staticmethod 387 def write_many(objs, writer, singular=None, plural=None): 388 if singular is None: 389 singular = 'affinity_rule' 390 if plural is None: 391 plural = 'affinity_rules' 392 writer.write_start(plural) 393 if isinstance(objs, List): 394 href = objs.href 395 if href is not None: 396 writer.write_attribute('href', href) 397 for obj in objs: 398 AffinityRuleWriter.write_one(obj, writer, singular) 399 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
370 @staticmethod 371 def write_one(obj, writer, singular=None): 372 if singular is None: 373 singular = 'affinity_rule' 374 writer.write_start(singular) 375 href = obj.href 376 if href is not None: 377 writer.write_attribute('href', href) 378 if obj.enabled is not None: 379 Writer.write_boolean(writer, 'enabled', obj.enabled) 380 if obj.enforcing is not None: 381 Writer.write_boolean(writer, 'enforcing', obj.enforcing) 382 if obj.positive is not None: 383 Writer.write_boolean(writer, 'positive', obj.positive) 384 writer.write_end()
386 @staticmethod 387 def write_many(objs, writer, singular=None, plural=None): 388 if singular is None: 389 singular = 'affinity_rule' 390 if plural is None: 391 plural = 'affinity_rules' 392 writer.write_start(plural) 393 if isinstance(objs, List): 394 href = objs.href 395 if href is not None: 396 writer.write_attribute('href', href) 397 for obj in objs: 398 AffinityRuleWriter.write_one(obj, writer, singular) 399 writer.write_end()
402class AgentWriter(Writer): 403 404 def __init__(self): 405 super(AgentWriter, self).__init__() 406 407 @staticmethod 408 def write_one(obj, writer, singular=None): 409 if singular is None: 410 singular = 'agent' 411 writer.write_start(singular) 412 href = obj.href 413 if href is not None: 414 writer.write_attribute('href', href) 415 if obj.id is not None: 416 writer.write_attribute('id', obj.id) 417 if obj.address is not None: 418 Writer.write_string(writer, 'address', obj.address) 419 if obj.comment is not None: 420 Writer.write_string(writer, 'comment', obj.comment) 421 if obj.concurrent is not None: 422 Writer.write_boolean(writer, 'concurrent', obj.concurrent) 423 if obj.description is not None: 424 Writer.write_string(writer, 'description', obj.description) 425 if obj.encrypt_options is not None: 426 Writer.write_boolean(writer, 'encrypt_options', obj.encrypt_options) 427 if obj.name is not None: 428 Writer.write_string(writer, 'name', obj.name) 429 if obj.options is not None: 430 OptionWriter.write_many(obj.options, writer, 'option', 'options') 431 if obj.order is not None: 432 Writer.write_integer(writer, 'order', obj.order) 433 if obj.password is not None: 434 Writer.write_string(writer, 'password', obj.password) 435 if obj.port is not None: 436 Writer.write_integer(writer, 'port', obj.port) 437 if obj.type is not None: 438 Writer.write_string(writer, 'type', obj.type) 439 if obj.username is not None: 440 Writer.write_string(writer, 'username', obj.username) 441 if obj.host is not None: 442 HostWriter.write_one(obj.host, writer, 'host') 443 writer.write_end() 444 445 @staticmethod 446 def write_many(objs, writer, singular=None, plural=None): 447 if singular is None: 448 singular = 'agent' 449 if plural is None: 450 plural = 'agents' 451 writer.write_start(plural) 452 if isinstance(objs, List): 453 href = objs.href 454 if href is not None: 455 writer.write_attribute('href', href) 456 for obj in objs: 457 AgentWriter.write_one(obj, writer, singular) 458 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
407 @staticmethod 408 def write_one(obj, writer, singular=None): 409 if singular is None: 410 singular = 'agent' 411 writer.write_start(singular) 412 href = obj.href 413 if href is not None: 414 writer.write_attribute('href', href) 415 if obj.id is not None: 416 writer.write_attribute('id', obj.id) 417 if obj.address is not None: 418 Writer.write_string(writer, 'address', obj.address) 419 if obj.comment is not None: 420 Writer.write_string(writer, 'comment', obj.comment) 421 if obj.concurrent is not None: 422 Writer.write_boolean(writer, 'concurrent', obj.concurrent) 423 if obj.description is not None: 424 Writer.write_string(writer, 'description', obj.description) 425 if obj.encrypt_options is not None: 426 Writer.write_boolean(writer, 'encrypt_options', obj.encrypt_options) 427 if obj.name is not None: 428 Writer.write_string(writer, 'name', obj.name) 429 if obj.options is not None: 430 OptionWriter.write_many(obj.options, writer, 'option', 'options') 431 if obj.order is not None: 432 Writer.write_integer(writer, 'order', obj.order) 433 if obj.password is not None: 434 Writer.write_string(writer, 'password', obj.password) 435 if obj.port is not None: 436 Writer.write_integer(writer, 'port', obj.port) 437 if obj.type is not None: 438 Writer.write_string(writer, 'type', obj.type) 439 if obj.username is not None: 440 Writer.write_string(writer, 'username', obj.username) 441 if obj.host is not None: 442 HostWriter.write_one(obj.host, writer, 'host') 443 writer.write_end()
445 @staticmethod 446 def write_many(objs, writer, singular=None, plural=None): 447 if singular is None: 448 singular = 'agent' 449 if plural is None: 450 plural = 'agents' 451 writer.write_start(plural) 452 if isinstance(objs, List): 453 href = objs.href 454 if href is not None: 455 writer.write_attribute('href', href) 456 for obj in objs: 457 AgentWriter.write_one(obj, writer, singular) 458 writer.write_end()
461class AgentConfigurationWriter(Writer): 462 463 def __init__(self): 464 super(AgentConfigurationWriter, self).__init__() 465 466 @staticmethod 467 def write_one(obj, writer, singular=None): 468 if singular is None: 469 singular = 'agent_configuration' 470 writer.write_start(singular) 471 href = obj.href 472 if href is not None: 473 writer.write_attribute('href', href) 474 if obj.address is not None: 475 Writer.write_string(writer, 'address', obj.address) 476 if obj.broker_type is not None: 477 Writer.write_string(writer, 'broker_type', obj.broker_type.value) 478 if obj.network_mappings is not None: 479 Writer.write_string(writer, 'network_mappings', obj.network_mappings) 480 if obj.password is not None: 481 Writer.write_string(writer, 'password', obj.password) 482 if obj.port is not None: 483 Writer.write_integer(writer, 'port', obj.port) 484 if obj.username is not None: 485 Writer.write_string(writer, 'username', obj.username) 486 writer.write_end() 487 488 @staticmethod 489 def write_many(objs, writer, singular=None, plural=None): 490 if singular is None: 491 singular = 'agent_configuration' 492 if plural is None: 493 plural = 'agent_configurations' 494 writer.write_start(plural) 495 if isinstance(objs, List): 496 href = objs.href 497 if href is not None: 498 writer.write_attribute('href', href) 499 for obj in objs: 500 AgentConfigurationWriter.write_one(obj, writer, singular) 501 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
466 @staticmethod 467 def write_one(obj, writer, singular=None): 468 if singular is None: 469 singular = 'agent_configuration' 470 writer.write_start(singular) 471 href = obj.href 472 if href is not None: 473 writer.write_attribute('href', href) 474 if obj.address is not None: 475 Writer.write_string(writer, 'address', obj.address) 476 if obj.broker_type is not None: 477 Writer.write_string(writer, 'broker_type', obj.broker_type.value) 478 if obj.network_mappings is not None: 479 Writer.write_string(writer, 'network_mappings', obj.network_mappings) 480 if obj.password is not None: 481 Writer.write_string(writer, 'password', obj.password) 482 if obj.port is not None: 483 Writer.write_integer(writer, 'port', obj.port) 484 if obj.username is not None: 485 Writer.write_string(writer, 'username', obj.username) 486 writer.write_end()
488 @staticmethod 489 def write_many(objs, writer, singular=None, plural=None): 490 if singular is None: 491 singular = 'agent_configuration' 492 if plural is None: 493 plural = 'agent_configurations' 494 writer.write_start(plural) 495 if isinstance(objs, List): 496 href = objs.href 497 if href is not None: 498 writer.write_attribute('href', href) 499 for obj in objs: 500 AgentConfigurationWriter.write_one(obj, writer, singular) 501 writer.write_end()
504class ApiWriter(Writer): 505 506 def __init__(self): 507 super(ApiWriter, self).__init__() 508 509 @staticmethod 510 def write_one(obj, writer, singular=None): 511 if singular is None: 512 singular = 'api' 513 writer.write_start(singular) 514 href = obj.href 515 if href is not None: 516 writer.write_attribute('href', href) 517 if obj.engine_backup is not None: 518 EngineBackupInfoWriter.write_one(obj.engine_backup, writer, 'engine_backup') 519 if obj.product_info is not None: 520 ProductInfoWriter.write_one(obj.product_info, writer, 'product_info') 521 if obj.special_objects is not None: 522 SpecialObjectsWriter.write_one(obj.special_objects, writer, 'special_objects') 523 if obj.summary is not None: 524 ApiSummaryWriter.write_one(obj.summary, writer, 'summary') 525 if obj.time is not None: 526 Writer.write_date(writer, 'time', obj.time) 527 if obj.authenticated_user is not None: 528 UserWriter.write_one(obj.authenticated_user, writer, 'authenticated_user') 529 if obj.effective_user is not None: 530 UserWriter.write_one(obj.effective_user, writer, 'effective_user') 531 writer.write_end() 532 533 @staticmethod 534 def write_many(objs, writer, singular=None, plural=None): 535 if singular is None: 536 singular = 'api' 537 if plural is None: 538 plural = 'apis' 539 writer.write_start(plural) 540 if isinstance(objs, List): 541 href = objs.href 542 if href is not None: 543 writer.write_attribute('href', href) 544 for obj in objs: 545 ApiWriter.write_one(obj, writer, singular) 546 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
509 @staticmethod 510 def write_one(obj, writer, singular=None): 511 if singular is None: 512 singular = 'api' 513 writer.write_start(singular) 514 href = obj.href 515 if href is not None: 516 writer.write_attribute('href', href) 517 if obj.engine_backup is not None: 518 EngineBackupInfoWriter.write_one(obj.engine_backup, writer, 'engine_backup') 519 if obj.product_info is not None: 520 ProductInfoWriter.write_one(obj.product_info, writer, 'product_info') 521 if obj.special_objects is not None: 522 SpecialObjectsWriter.write_one(obj.special_objects, writer, 'special_objects') 523 if obj.summary is not None: 524 ApiSummaryWriter.write_one(obj.summary, writer, 'summary') 525 if obj.time is not None: 526 Writer.write_date(writer, 'time', obj.time) 527 if obj.authenticated_user is not None: 528 UserWriter.write_one(obj.authenticated_user, writer, 'authenticated_user') 529 if obj.effective_user is not None: 530 UserWriter.write_one(obj.effective_user, writer, 'effective_user') 531 writer.write_end()
533 @staticmethod 534 def write_many(objs, writer, singular=None, plural=None): 535 if singular is None: 536 singular = 'api' 537 if plural is None: 538 plural = 'apis' 539 writer.write_start(plural) 540 if isinstance(objs, List): 541 href = objs.href 542 if href is not None: 543 writer.write_attribute('href', href) 544 for obj in objs: 545 ApiWriter.write_one(obj, writer, singular) 546 writer.write_end()
549class ApiSummaryWriter(Writer): 550 551 def __init__(self): 552 super(ApiSummaryWriter, self).__init__() 553 554 @staticmethod 555 def write_one(obj, writer, singular=None): 556 if singular is None: 557 singular = 'api_summary' 558 writer.write_start(singular) 559 href = obj.href 560 if href is not None: 561 writer.write_attribute('href', href) 562 if obj.hosts is not None: 563 ApiSummaryItemWriter.write_one(obj.hosts, writer, 'hosts') 564 if obj.storage_domains is not None: 565 ApiSummaryItemWriter.write_one(obj.storage_domains, writer, 'storage_domains') 566 if obj.users is not None: 567 ApiSummaryItemWriter.write_one(obj.users, writer, 'users') 568 if obj.vms is not None: 569 ApiSummaryItemWriter.write_one(obj.vms, writer, 'vms') 570 writer.write_end() 571 572 @staticmethod 573 def write_many(objs, writer, singular=None, plural=None): 574 if singular is None: 575 singular = 'api_summary' 576 if plural is None: 577 plural = 'api_summaries' 578 writer.write_start(plural) 579 if isinstance(objs, List): 580 href = objs.href 581 if href is not None: 582 writer.write_attribute('href', href) 583 for obj in objs: 584 ApiSummaryWriter.write_one(obj, writer, singular) 585 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
554 @staticmethod 555 def write_one(obj, writer, singular=None): 556 if singular is None: 557 singular = 'api_summary' 558 writer.write_start(singular) 559 href = obj.href 560 if href is not None: 561 writer.write_attribute('href', href) 562 if obj.hosts is not None: 563 ApiSummaryItemWriter.write_one(obj.hosts, writer, 'hosts') 564 if obj.storage_domains is not None: 565 ApiSummaryItemWriter.write_one(obj.storage_domains, writer, 'storage_domains') 566 if obj.users is not None: 567 ApiSummaryItemWriter.write_one(obj.users, writer, 'users') 568 if obj.vms is not None: 569 ApiSummaryItemWriter.write_one(obj.vms, writer, 'vms') 570 writer.write_end()
572 @staticmethod 573 def write_many(objs, writer, singular=None, plural=None): 574 if singular is None: 575 singular = 'api_summary' 576 if plural is None: 577 plural = 'api_summaries' 578 writer.write_start(plural) 579 if isinstance(objs, List): 580 href = objs.href 581 if href is not None: 582 writer.write_attribute('href', href) 583 for obj in objs: 584 ApiSummaryWriter.write_one(obj, writer, singular) 585 writer.write_end()
588class ApiSummaryItemWriter(Writer): 589 590 def __init__(self): 591 super(ApiSummaryItemWriter, self).__init__() 592 593 @staticmethod 594 def write_one(obj, writer, singular=None): 595 if singular is None: 596 singular = 'api_summary_item' 597 writer.write_start(singular) 598 href = obj.href 599 if href is not None: 600 writer.write_attribute('href', href) 601 if obj.active is not None: 602 Writer.write_integer(writer, 'active', obj.active) 603 if obj.total is not None: 604 Writer.write_integer(writer, 'total', obj.total) 605 writer.write_end() 606 607 @staticmethod 608 def write_many(objs, writer, singular=None, plural=None): 609 if singular is None: 610 singular = 'api_summary_item' 611 if plural is None: 612 plural = 'api_summary_items' 613 writer.write_start(plural) 614 if isinstance(objs, List): 615 href = objs.href 616 if href is not None: 617 writer.write_attribute('href', href) 618 for obj in objs: 619 ApiSummaryItemWriter.write_one(obj, writer, singular) 620 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
593 @staticmethod 594 def write_one(obj, writer, singular=None): 595 if singular is None: 596 singular = 'api_summary_item' 597 writer.write_start(singular) 598 href = obj.href 599 if href is not None: 600 writer.write_attribute('href', href) 601 if obj.active is not None: 602 Writer.write_integer(writer, 'active', obj.active) 603 if obj.total is not None: 604 Writer.write_integer(writer, 'total', obj.total) 605 writer.write_end()
607 @staticmethod 608 def write_many(objs, writer, singular=None, plural=None): 609 if singular is None: 610 singular = 'api_summary_item' 611 if plural is None: 612 plural = 'api_summary_items' 613 writer.write_start(plural) 614 if isinstance(objs, List): 615 href = objs.href 616 if href is not None: 617 writer.write_attribute('href', href) 618 for obj in objs: 619 ApiSummaryItemWriter.write_one(obj, writer, singular) 620 writer.write_end()
623class ApplicationWriter(Writer): 624 625 def __init__(self): 626 super(ApplicationWriter, self).__init__() 627 628 @staticmethod 629 def write_one(obj, writer, singular=None): 630 if singular is None: 631 singular = 'application' 632 writer.write_start(singular) 633 href = obj.href 634 if href is not None: 635 writer.write_attribute('href', href) 636 if obj.id is not None: 637 writer.write_attribute('id', obj.id) 638 if obj.comment is not None: 639 Writer.write_string(writer, 'comment', obj.comment) 640 if obj.description is not None: 641 Writer.write_string(writer, 'description', obj.description) 642 if obj.name is not None: 643 Writer.write_string(writer, 'name', obj.name) 644 if obj.vm is not None: 645 VmWriter.write_one(obj.vm, writer, 'vm') 646 writer.write_end() 647 648 @staticmethod 649 def write_many(objs, writer, singular=None, plural=None): 650 if singular is None: 651 singular = 'application' 652 if plural is None: 653 plural = 'applications' 654 writer.write_start(plural) 655 if isinstance(objs, List): 656 href = objs.href 657 if href is not None: 658 writer.write_attribute('href', href) 659 for obj in objs: 660 ApplicationWriter.write_one(obj, writer, singular) 661 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
628 @staticmethod 629 def write_one(obj, writer, singular=None): 630 if singular is None: 631 singular = 'application' 632 writer.write_start(singular) 633 href = obj.href 634 if href is not None: 635 writer.write_attribute('href', href) 636 if obj.id is not None: 637 writer.write_attribute('id', obj.id) 638 if obj.comment is not None: 639 Writer.write_string(writer, 'comment', obj.comment) 640 if obj.description is not None: 641 Writer.write_string(writer, 'description', obj.description) 642 if obj.name is not None: 643 Writer.write_string(writer, 'name', obj.name) 644 if obj.vm is not None: 645 VmWriter.write_one(obj.vm, writer, 'vm') 646 writer.write_end()
648 @staticmethod 649 def write_many(objs, writer, singular=None, plural=None): 650 if singular is None: 651 singular = 'application' 652 if plural is None: 653 plural = 'applications' 654 writer.write_start(plural) 655 if isinstance(objs, List): 656 href = objs.href 657 if href is not None: 658 writer.write_attribute('href', href) 659 for obj in objs: 660 ApplicationWriter.write_one(obj, writer, singular) 661 writer.write_end()
664class AuthorizedKeyWriter(Writer): 665 666 def __init__(self): 667 super(AuthorizedKeyWriter, self).__init__() 668 669 @staticmethod 670 def write_one(obj, writer, singular=None): 671 if singular is None: 672 singular = 'authorized_key' 673 writer.write_start(singular) 674 href = obj.href 675 if href is not None: 676 writer.write_attribute('href', href) 677 if obj.id is not None: 678 writer.write_attribute('id', obj.id) 679 if obj.comment is not None: 680 Writer.write_string(writer, 'comment', obj.comment) 681 if obj.description is not None: 682 Writer.write_string(writer, 'description', obj.description) 683 if obj.key is not None: 684 Writer.write_string(writer, 'key', obj.key) 685 if obj.name is not None: 686 Writer.write_string(writer, 'name', obj.name) 687 if obj.user is not None: 688 UserWriter.write_one(obj.user, writer, 'user') 689 writer.write_end() 690 691 @staticmethod 692 def write_many(objs, writer, singular=None, plural=None): 693 if singular is None: 694 singular = 'authorized_key' 695 if plural is None: 696 plural = 'authorized_keys' 697 writer.write_start(plural) 698 if isinstance(objs, List): 699 href = objs.href 700 if href is not None: 701 writer.write_attribute('href', href) 702 for obj in objs: 703 AuthorizedKeyWriter.write_one(obj, writer, singular) 704 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
669 @staticmethod 670 def write_one(obj, writer, singular=None): 671 if singular is None: 672 singular = 'authorized_key' 673 writer.write_start(singular) 674 href = obj.href 675 if href is not None: 676 writer.write_attribute('href', href) 677 if obj.id is not None: 678 writer.write_attribute('id', obj.id) 679 if obj.comment is not None: 680 Writer.write_string(writer, 'comment', obj.comment) 681 if obj.description is not None: 682 Writer.write_string(writer, 'description', obj.description) 683 if obj.key is not None: 684 Writer.write_string(writer, 'key', obj.key) 685 if obj.name is not None: 686 Writer.write_string(writer, 'name', obj.name) 687 if obj.user is not None: 688 UserWriter.write_one(obj.user, writer, 'user') 689 writer.write_end()
691 @staticmethod 692 def write_many(objs, writer, singular=None, plural=None): 693 if singular is None: 694 singular = 'authorized_key' 695 if plural is None: 696 plural = 'authorized_keys' 697 writer.write_start(plural) 698 if isinstance(objs, List): 699 href = objs.href 700 if href is not None: 701 writer.write_attribute('href', href) 702 for obj in objs: 703 AuthorizedKeyWriter.write_one(obj, writer, singular) 704 writer.write_end()
707class BackupWriter(Writer): 708 709 def __init__(self): 710 super(BackupWriter, self).__init__() 711 712 @staticmethod 713 def write_one(obj, writer, singular=None): 714 if singular is None: 715 singular = 'backup' 716 writer.write_start(singular) 717 href = obj.href 718 if href is not None: 719 writer.write_attribute('href', href) 720 if obj.id is not None: 721 writer.write_attribute('id', obj.id) 722 if obj.comment is not None: 723 Writer.write_string(writer, 'comment', obj.comment) 724 if obj.creation_date is not None: 725 Writer.write_date(writer, 'creation_date', obj.creation_date) 726 if obj.description is not None: 727 Writer.write_string(writer, 'description', obj.description) 728 if obj.from_checkpoint_id is not None: 729 Writer.write_string(writer, 'from_checkpoint_id', obj.from_checkpoint_id) 730 if obj.modification_date is not None: 731 Writer.write_date(writer, 'modification_date', obj.modification_date) 732 if obj.name is not None: 733 Writer.write_string(writer, 'name', obj.name) 734 if obj.phase is not None: 735 Writer.write_string(writer, 'phase', obj.phase.value) 736 if obj.to_checkpoint_id is not None: 737 Writer.write_string(writer, 'to_checkpoint_id', obj.to_checkpoint_id) 738 if obj.disks is not None: 739 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 740 if obj.host is not None: 741 HostWriter.write_one(obj.host, writer, 'host') 742 if obj.snapshot is not None: 743 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 744 if obj.vm is not None: 745 VmWriter.write_one(obj.vm, writer, 'vm') 746 writer.write_end() 747 748 @staticmethod 749 def write_many(objs, writer, singular=None, plural=None): 750 if singular is None: 751 singular = 'backup' 752 if plural is None: 753 plural = 'backups' 754 writer.write_start(plural) 755 if isinstance(objs, List): 756 href = objs.href 757 if href is not None: 758 writer.write_attribute('href', href) 759 for obj in objs: 760 BackupWriter.write_one(obj, writer, singular) 761 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
712 @staticmethod 713 def write_one(obj, writer, singular=None): 714 if singular is None: 715 singular = 'backup' 716 writer.write_start(singular) 717 href = obj.href 718 if href is not None: 719 writer.write_attribute('href', href) 720 if obj.id is not None: 721 writer.write_attribute('id', obj.id) 722 if obj.comment is not None: 723 Writer.write_string(writer, 'comment', obj.comment) 724 if obj.creation_date is not None: 725 Writer.write_date(writer, 'creation_date', obj.creation_date) 726 if obj.description is not None: 727 Writer.write_string(writer, 'description', obj.description) 728 if obj.from_checkpoint_id is not None: 729 Writer.write_string(writer, 'from_checkpoint_id', obj.from_checkpoint_id) 730 if obj.modification_date is not None: 731 Writer.write_date(writer, 'modification_date', obj.modification_date) 732 if obj.name is not None: 733 Writer.write_string(writer, 'name', obj.name) 734 if obj.phase is not None: 735 Writer.write_string(writer, 'phase', obj.phase.value) 736 if obj.to_checkpoint_id is not None: 737 Writer.write_string(writer, 'to_checkpoint_id', obj.to_checkpoint_id) 738 if obj.disks is not None: 739 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 740 if obj.host is not None: 741 HostWriter.write_one(obj.host, writer, 'host') 742 if obj.snapshot is not None: 743 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 744 if obj.vm is not None: 745 VmWriter.write_one(obj.vm, writer, 'vm') 746 writer.write_end()
748 @staticmethod 749 def write_many(objs, writer, singular=None, plural=None): 750 if singular is None: 751 singular = 'backup' 752 if plural is None: 753 plural = 'backups' 754 writer.write_start(plural) 755 if isinstance(objs, List): 756 href = objs.href 757 if href is not None: 758 writer.write_attribute('href', href) 759 for obj in objs: 760 BackupWriter.write_one(obj, writer, singular) 761 writer.write_end()
764class BalanceWriter(Writer): 765 766 def __init__(self): 767 super(BalanceWriter, self).__init__() 768 769 @staticmethod 770 def write_one(obj, writer, singular=None): 771 if singular is None: 772 singular = 'balance' 773 writer.write_start(singular) 774 href = obj.href 775 if href is not None: 776 writer.write_attribute('href', href) 777 if obj.id is not None: 778 writer.write_attribute('id', obj.id) 779 if obj.comment is not None: 780 Writer.write_string(writer, 'comment', obj.comment) 781 if obj.description is not None: 782 Writer.write_string(writer, 'description', obj.description) 783 if obj.name is not None: 784 Writer.write_string(writer, 'name', obj.name) 785 if obj.scheduling_policy is not None: 786 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 787 if obj.scheduling_policy_unit is not None: 788 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 789 writer.write_end() 790 791 @staticmethod 792 def write_many(objs, writer, singular=None, plural=None): 793 if singular is None: 794 singular = 'balance' 795 if plural is None: 796 plural = 'balances' 797 writer.write_start(plural) 798 if isinstance(objs, List): 799 href = objs.href 800 if href is not None: 801 writer.write_attribute('href', href) 802 for obj in objs: 803 BalanceWriter.write_one(obj, writer, singular) 804 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
769 @staticmethod 770 def write_one(obj, writer, singular=None): 771 if singular is None: 772 singular = 'balance' 773 writer.write_start(singular) 774 href = obj.href 775 if href is not None: 776 writer.write_attribute('href', href) 777 if obj.id is not None: 778 writer.write_attribute('id', obj.id) 779 if obj.comment is not None: 780 Writer.write_string(writer, 'comment', obj.comment) 781 if obj.description is not None: 782 Writer.write_string(writer, 'description', obj.description) 783 if obj.name is not None: 784 Writer.write_string(writer, 'name', obj.name) 785 if obj.scheduling_policy is not None: 786 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 787 if obj.scheduling_policy_unit is not None: 788 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 789 writer.write_end()
791 @staticmethod 792 def write_many(objs, writer, singular=None, plural=None): 793 if singular is None: 794 singular = 'balance' 795 if plural is None: 796 plural = 'balances' 797 writer.write_start(plural) 798 if isinstance(objs, List): 799 href = objs.href 800 if href is not None: 801 writer.write_attribute('href', href) 802 for obj in objs: 803 BalanceWriter.write_one(obj, writer, singular) 804 writer.write_end()
807class BiosWriter(Writer): 808 809 def __init__(self): 810 super(BiosWriter, self).__init__() 811 812 @staticmethod 813 def write_one(obj, writer, singular=None): 814 if singular is None: 815 singular = 'bios' 816 writer.write_start(singular) 817 href = obj.href 818 if href is not None: 819 writer.write_attribute('href', href) 820 if obj.boot_menu is not None: 821 BootMenuWriter.write_one(obj.boot_menu, writer, 'boot_menu') 822 if obj.type is not None: 823 Writer.write_string(writer, 'type', obj.type.value) 824 writer.write_end() 825 826 @staticmethod 827 def write_many(objs, writer, singular=None, plural=None): 828 if singular is None: 829 singular = 'bios' 830 if plural is None: 831 plural = 'bioss' 832 writer.write_start(plural) 833 if isinstance(objs, List): 834 href = objs.href 835 if href is not None: 836 writer.write_attribute('href', href) 837 for obj in objs: 838 BiosWriter.write_one(obj, writer, singular) 839 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
812 @staticmethod 813 def write_one(obj, writer, singular=None): 814 if singular is None: 815 singular = 'bios' 816 writer.write_start(singular) 817 href = obj.href 818 if href is not None: 819 writer.write_attribute('href', href) 820 if obj.boot_menu is not None: 821 BootMenuWriter.write_one(obj.boot_menu, writer, 'boot_menu') 822 if obj.type is not None: 823 Writer.write_string(writer, 'type', obj.type.value) 824 writer.write_end()
826 @staticmethod 827 def write_many(objs, writer, singular=None, plural=None): 828 if singular is None: 829 singular = 'bios' 830 if plural is None: 831 plural = 'bioss' 832 writer.write_start(plural) 833 if isinstance(objs, List): 834 href = objs.href 835 if href is not None: 836 writer.write_attribute('href', href) 837 for obj in objs: 838 BiosWriter.write_one(obj, writer, singular) 839 writer.write_end()
842class BlockStatisticWriter(Writer): 843 844 def __init__(self): 845 super(BlockStatisticWriter, self).__init__() 846 847 @staticmethod 848 def write_one(obj, writer, singular=None): 849 if singular is None: 850 singular = 'block_statistic' 851 writer.write_start(singular) 852 href = obj.href 853 if href is not None: 854 writer.write_attribute('href', href) 855 if obj.statistics is not None: 856 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 857 writer.write_end() 858 859 @staticmethod 860 def write_many(objs, writer, singular=None, plural=None): 861 if singular is None: 862 singular = 'block_statistic' 863 if plural is None: 864 plural = 'block_statistics' 865 writer.write_start(plural) 866 if isinstance(objs, List): 867 href = objs.href 868 if href is not None: 869 writer.write_attribute('href', href) 870 for obj in objs: 871 BlockStatisticWriter.write_one(obj, writer, singular) 872 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
847 @staticmethod 848 def write_one(obj, writer, singular=None): 849 if singular is None: 850 singular = 'block_statistic' 851 writer.write_start(singular) 852 href = obj.href 853 if href is not None: 854 writer.write_attribute('href', href) 855 if obj.statistics is not None: 856 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 857 writer.write_end()
859 @staticmethod 860 def write_many(objs, writer, singular=None, plural=None): 861 if singular is None: 862 singular = 'block_statistic' 863 if plural is None: 864 plural = 'block_statistics' 865 writer.write_start(plural) 866 if isinstance(objs, List): 867 href = objs.href 868 if href is not None: 869 writer.write_attribute('href', href) 870 for obj in objs: 871 BlockStatisticWriter.write_one(obj, writer, singular) 872 writer.write_end()
875class BondingWriter(Writer): 876 877 def __init__(self): 878 super(BondingWriter, self).__init__() 879 880 @staticmethod 881 def write_one(obj, writer, singular=None): 882 if singular is None: 883 singular = 'bonding' 884 writer.write_start(singular) 885 href = obj.href 886 if href is not None: 887 writer.write_attribute('href', href) 888 if obj.ad_partner_mac is not None: 889 MacWriter.write_one(obj.ad_partner_mac, writer, 'ad_partner_mac') 890 if obj.options is not None: 891 OptionWriter.write_many(obj.options, writer, 'option', 'options') 892 if obj.slaves is not None: 893 HostNicWriter.write_many(obj.slaves, writer, 'host_nic', 'slaves') 894 if obj.active_slave is not None: 895 HostNicWriter.write_one(obj.active_slave, writer, 'active_slave') 896 writer.write_end() 897 898 @staticmethod 899 def write_many(objs, writer, singular=None, plural=None): 900 if singular is None: 901 singular = 'bonding' 902 if plural is None: 903 plural = 'bondings' 904 writer.write_start(plural) 905 if isinstance(objs, List): 906 href = objs.href 907 if href is not None: 908 writer.write_attribute('href', href) 909 for obj in objs: 910 BondingWriter.write_one(obj, writer, singular) 911 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
880 @staticmethod 881 def write_one(obj, writer, singular=None): 882 if singular is None: 883 singular = 'bonding' 884 writer.write_start(singular) 885 href = obj.href 886 if href is not None: 887 writer.write_attribute('href', href) 888 if obj.ad_partner_mac is not None: 889 MacWriter.write_one(obj.ad_partner_mac, writer, 'ad_partner_mac') 890 if obj.options is not None: 891 OptionWriter.write_many(obj.options, writer, 'option', 'options') 892 if obj.slaves is not None: 893 HostNicWriter.write_many(obj.slaves, writer, 'host_nic', 'slaves') 894 if obj.active_slave is not None: 895 HostNicWriter.write_one(obj.active_slave, writer, 'active_slave') 896 writer.write_end()
898 @staticmethod 899 def write_many(objs, writer, singular=None, plural=None): 900 if singular is None: 901 singular = 'bonding' 902 if plural is None: 903 plural = 'bondings' 904 writer.write_start(plural) 905 if isinstance(objs, List): 906 href = objs.href 907 if href is not None: 908 writer.write_attribute('href', href) 909 for obj in objs: 910 BondingWriter.write_one(obj, writer, singular) 911 writer.write_end()
914class BookmarkWriter(Writer): 915 916 def __init__(self): 917 super(BookmarkWriter, self).__init__() 918 919 @staticmethod 920 def write_one(obj, writer, singular=None): 921 if singular is None: 922 singular = 'bookmark' 923 writer.write_start(singular) 924 href = obj.href 925 if href is not None: 926 writer.write_attribute('href', href) 927 if obj.id is not None: 928 writer.write_attribute('id', obj.id) 929 if obj.comment is not None: 930 Writer.write_string(writer, 'comment', obj.comment) 931 if obj.description is not None: 932 Writer.write_string(writer, 'description', obj.description) 933 if obj.name is not None: 934 Writer.write_string(writer, 'name', obj.name) 935 if obj.value is not None: 936 Writer.write_string(writer, 'value', obj.value) 937 writer.write_end() 938 939 @staticmethod 940 def write_many(objs, writer, singular=None, plural=None): 941 if singular is None: 942 singular = 'bookmark' 943 if plural is None: 944 plural = 'bookmarks' 945 writer.write_start(plural) 946 if isinstance(objs, List): 947 href = objs.href 948 if href is not None: 949 writer.write_attribute('href', href) 950 for obj in objs: 951 BookmarkWriter.write_one(obj, writer, singular) 952 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
919 @staticmethod 920 def write_one(obj, writer, singular=None): 921 if singular is None: 922 singular = 'bookmark' 923 writer.write_start(singular) 924 href = obj.href 925 if href is not None: 926 writer.write_attribute('href', href) 927 if obj.id is not None: 928 writer.write_attribute('id', obj.id) 929 if obj.comment is not None: 930 Writer.write_string(writer, 'comment', obj.comment) 931 if obj.description is not None: 932 Writer.write_string(writer, 'description', obj.description) 933 if obj.name is not None: 934 Writer.write_string(writer, 'name', obj.name) 935 if obj.value is not None: 936 Writer.write_string(writer, 'value', obj.value) 937 writer.write_end()
939 @staticmethod 940 def write_many(objs, writer, singular=None, plural=None): 941 if singular is None: 942 singular = 'bookmark' 943 if plural is None: 944 plural = 'bookmarks' 945 writer.write_start(plural) 946 if isinstance(objs, List): 947 href = objs.href 948 if href is not None: 949 writer.write_attribute('href', href) 950 for obj in objs: 951 BookmarkWriter.write_one(obj, writer, singular) 952 writer.write_end()
955class BootWriter(Writer): 956 957 def __init__(self): 958 super(BootWriter, self).__init__() 959 960 @staticmethod 961 def write_one(obj, writer, singular=None): 962 if singular is None: 963 singular = 'boot' 964 writer.write_start(singular) 965 href = obj.href 966 if href is not None: 967 writer.write_attribute('href', href) 968 if obj.devices is not None: 969 writer.write_start('devices') 970 for item in obj.devices: 971 if item is not None: 972 Writer.write_string(writer, 'device', item.value) 973 writer.write_end() 974 writer.write_end() 975 976 @staticmethod 977 def write_many(objs, writer, singular=None, plural=None): 978 if singular is None: 979 singular = 'boot' 980 if plural is None: 981 plural = 'boots' 982 writer.write_start(plural) 983 if isinstance(objs, List): 984 href = objs.href 985 if href is not None: 986 writer.write_attribute('href', href) 987 for obj in objs: 988 BootWriter.write_one(obj, writer, singular) 989 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
960 @staticmethod 961 def write_one(obj, writer, singular=None): 962 if singular is None: 963 singular = 'boot' 964 writer.write_start(singular) 965 href = obj.href 966 if href is not None: 967 writer.write_attribute('href', href) 968 if obj.devices is not None: 969 writer.write_start('devices') 970 for item in obj.devices: 971 if item is not None: 972 Writer.write_string(writer, 'device', item.value) 973 writer.write_end() 974 writer.write_end()
976 @staticmethod 977 def write_many(objs, writer, singular=None, plural=None): 978 if singular is None: 979 singular = 'boot' 980 if plural is None: 981 plural = 'boots' 982 writer.write_start(plural) 983 if isinstance(objs, List): 984 href = objs.href 985 if href is not None: 986 writer.write_attribute('href', href) 987 for obj in objs: 988 BootWriter.write_one(obj, writer, singular) 989 writer.write_end()
992class BootMenuWriter(Writer): 993 994 def __init__(self): 995 super(BootMenuWriter, self).__init__() 996 997 @staticmethod 998 def write_one(obj, writer, singular=None): 999 if singular is None: 1000 singular = 'boot_menu' 1001 writer.write_start(singular) 1002 href = obj.href 1003 if href is not None: 1004 writer.write_attribute('href', href) 1005 if obj.enabled is not None: 1006 Writer.write_boolean(writer, 'enabled', obj.enabled) 1007 writer.write_end() 1008 1009 @staticmethod 1010 def write_many(objs, writer, singular=None, plural=None): 1011 if singular is None: 1012 singular = 'boot_menu' 1013 if plural is None: 1014 plural = 'boot_menus' 1015 writer.write_start(plural) 1016 if isinstance(objs, List): 1017 href = objs.href 1018 if href is not None: 1019 writer.write_attribute('href', href) 1020 for obj in objs: 1021 BootMenuWriter.write_one(obj, writer, singular) 1022 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
997 @staticmethod 998 def write_one(obj, writer, singular=None): 999 if singular is None: 1000 singular = 'boot_menu' 1001 writer.write_start(singular) 1002 href = obj.href 1003 if href is not None: 1004 writer.write_attribute('href', href) 1005 if obj.enabled is not None: 1006 Writer.write_boolean(writer, 'enabled', obj.enabled) 1007 writer.write_end()
1009 @staticmethod 1010 def write_many(objs, writer, singular=None, plural=None): 1011 if singular is None: 1012 singular = 'boot_menu' 1013 if plural is None: 1014 plural = 'boot_menus' 1015 writer.write_start(plural) 1016 if isinstance(objs, List): 1017 href = objs.href 1018 if href is not None: 1019 writer.write_attribute('href', href) 1020 for obj in objs: 1021 BootMenuWriter.write_one(obj, writer, singular) 1022 writer.write_end()
1025class BrickProfileDetailWriter(Writer): 1026 1027 def __init__(self): 1028 super(BrickProfileDetailWriter, self).__init__() 1029 1030 @staticmethod 1031 def write_one(obj, writer, singular=None): 1032 if singular is None: 1033 singular = 'brick_profile_detail' 1034 writer.write_start(singular) 1035 href = obj.href 1036 if href is not None: 1037 writer.write_attribute('href', href) 1038 if obj.profile_details is not None: 1039 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 1040 if obj.brick is not None: 1041 GlusterBrickWriter.write_one(obj.brick, writer, 'brick') 1042 writer.write_end() 1043 1044 @staticmethod 1045 def write_many(objs, writer, singular=None, plural=None): 1046 if singular is None: 1047 singular = 'brick_profile_detail' 1048 if plural is None: 1049 plural = 'brick_profile_details' 1050 writer.write_start(plural) 1051 if isinstance(objs, List): 1052 href = objs.href 1053 if href is not None: 1054 writer.write_attribute('href', href) 1055 for obj in objs: 1056 BrickProfileDetailWriter.write_one(obj, writer, singular) 1057 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1030 @staticmethod 1031 def write_one(obj, writer, singular=None): 1032 if singular is None: 1033 singular = 'brick_profile_detail' 1034 writer.write_start(singular) 1035 href = obj.href 1036 if href is not None: 1037 writer.write_attribute('href', href) 1038 if obj.profile_details is not None: 1039 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 1040 if obj.brick is not None: 1041 GlusterBrickWriter.write_one(obj.brick, writer, 'brick') 1042 writer.write_end()
1044 @staticmethod 1045 def write_many(objs, writer, singular=None, plural=None): 1046 if singular is None: 1047 singular = 'brick_profile_detail' 1048 if plural is None: 1049 plural = 'brick_profile_details' 1050 writer.write_start(plural) 1051 if isinstance(objs, List): 1052 href = objs.href 1053 if href is not None: 1054 writer.write_attribute('href', href) 1055 for obj in objs: 1056 BrickProfileDetailWriter.write_one(obj, writer, singular) 1057 writer.write_end()
1060class CdromWriter(Writer): 1061 1062 def __init__(self): 1063 super(CdromWriter, self).__init__() 1064 1065 @staticmethod 1066 def write_one(obj, writer, singular=None): 1067 if singular is None: 1068 singular = 'cdrom' 1069 writer.write_start(singular) 1070 href = obj.href 1071 if href is not None: 1072 writer.write_attribute('href', href) 1073 if obj.id is not None: 1074 writer.write_attribute('id', obj.id) 1075 if obj.comment is not None: 1076 Writer.write_string(writer, 'comment', obj.comment) 1077 if obj.description is not None: 1078 Writer.write_string(writer, 'description', obj.description) 1079 if obj.file is not None: 1080 FileWriter.write_one(obj.file, writer, 'file') 1081 if obj.name is not None: 1082 Writer.write_string(writer, 'name', obj.name) 1083 if obj.instance_type is not None: 1084 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 1085 if obj.template is not None: 1086 TemplateWriter.write_one(obj.template, writer, 'template') 1087 if obj.vm is not None: 1088 VmWriter.write_one(obj.vm, writer, 'vm') 1089 if obj.vms is not None: 1090 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 1091 writer.write_end() 1092 1093 @staticmethod 1094 def write_many(objs, writer, singular=None, plural=None): 1095 if singular is None: 1096 singular = 'cdrom' 1097 if plural is None: 1098 plural = 'cdroms' 1099 writer.write_start(plural) 1100 if isinstance(objs, List): 1101 href = objs.href 1102 if href is not None: 1103 writer.write_attribute('href', href) 1104 for obj in objs: 1105 CdromWriter.write_one(obj, writer, singular) 1106 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1065 @staticmethod 1066 def write_one(obj, writer, singular=None): 1067 if singular is None: 1068 singular = 'cdrom' 1069 writer.write_start(singular) 1070 href = obj.href 1071 if href is not None: 1072 writer.write_attribute('href', href) 1073 if obj.id is not None: 1074 writer.write_attribute('id', obj.id) 1075 if obj.comment is not None: 1076 Writer.write_string(writer, 'comment', obj.comment) 1077 if obj.description is not None: 1078 Writer.write_string(writer, 'description', obj.description) 1079 if obj.file is not None: 1080 FileWriter.write_one(obj.file, writer, 'file') 1081 if obj.name is not None: 1082 Writer.write_string(writer, 'name', obj.name) 1083 if obj.instance_type is not None: 1084 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 1085 if obj.template is not None: 1086 TemplateWriter.write_one(obj.template, writer, 'template') 1087 if obj.vm is not None: 1088 VmWriter.write_one(obj.vm, writer, 'vm') 1089 if obj.vms is not None: 1090 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 1091 writer.write_end()
1093 @staticmethod 1094 def write_many(objs, writer, singular=None, plural=None): 1095 if singular is None: 1096 singular = 'cdrom' 1097 if plural is None: 1098 plural = 'cdroms' 1099 writer.write_start(plural) 1100 if isinstance(objs, List): 1101 href = objs.href 1102 if href is not None: 1103 writer.write_attribute('href', href) 1104 for obj in objs: 1105 CdromWriter.write_one(obj, writer, singular) 1106 writer.write_end()
1109class CertificateWriter(Writer): 1110 1111 def __init__(self): 1112 super(CertificateWriter, self).__init__() 1113 1114 @staticmethod 1115 def write_one(obj, writer, singular=None): 1116 if singular is None: 1117 singular = 'certificate' 1118 writer.write_start(singular) 1119 href = obj.href 1120 if href is not None: 1121 writer.write_attribute('href', href) 1122 if obj.id is not None: 1123 writer.write_attribute('id', obj.id) 1124 if obj.comment is not None: 1125 Writer.write_string(writer, 'comment', obj.comment) 1126 if obj.content is not None: 1127 Writer.write_string(writer, 'content', obj.content) 1128 if obj.description is not None: 1129 Writer.write_string(writer, 'description', obj.description) 1130 if obj.name is not None: 1131 Writer.write_string(writer, 'name', obj.name) 1132 if obj.organization is not None: 1133 Writer.write_string(writer, 'organization', obj.organization) 1134 if obj.subject is not None: 1135 Writer.write_string(writer, 'subject', obj.subject) 1136 writer.write_end() 1137 1138 @staticmethod 1139 def write_many(objs, writer, singular=None, plural=None): 1140 if singular is None: 1141 singular = 'certificate' 1142 if plural is None: 1143 plural = 'certificates' 1144 writer.write_start(plural) 1145 if isinstance(objs, List): 1146 href = objs.href 1147 if href is not None: 1148 writer.write_attribute('href', href) 1149 for obj in objs: 1150 CertificateWriter.write_one(obj, writer, singular) 1151 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1114 @staticmethod 1115 def write_one(obj, writer, singular=None): 1116 if singular is None: 1117 singular = 'certificate' 1118 writer.write_start(singular) 1119 href = obj.href 1120 if href is not None: 1121 writer.write_attribute('href', href) 1122 if obj.id is not None: 1123 writer.write_attribute('id', obj.id) 1124 if obj.comment is not None: 1125 Writer.write_string(writer, 'comment', obj.comment) 1126 if obj.content is not None: 1127 Writer.write_string(writer, 'content', obj.content) 1128 if obj.description is not None: 1129 Writer.write_string(writer, 'description', obj.description) 1130 if obj.name is not None: 1131 Writer.write_string(writer, 'name', obj.name) 1132 if obj.organization is not None: 1133 Writer.write_string(writer, 'organization', obj.organization) 1134 if obj.subject is not None: 1135 Writer.write_string(writer, 'subject', obj.subject) 1136 writer.write_end()
1138 @staticmethod 1139 def write_many(objs, writer, singular=None, plural=None): 1140 if singular is None: 1141 singular = 'certificate' 1142 if plural is None: 1143 plural = 'certificates' 1144 writer.write_start(plural) 1145 if isinstance(objs, List): 1146 href = objs.href 1147 if href is not None: 1148 writer.write_attribute('href', href) 1149 for obj in objs: 1150 CertificateWriter.write_one(obj, writer, singular) 1151 writer.write_end()
1154class CheckpointWriter(Writer): 1155 1156 def __init__(self): 1157 super(CheckpointWriter, self).__init__() 1158 1159 @staticmethod 1160 def write_one(obj, writer, singular=None): 1161 if singular is None: 1162 singular = 'checkpoint' 1163 writer.write_start(singular) 1164 href = obj.href 1165 if href is not None: 1166 writer.write_attribute('href', href) 1167 if obj.id is not None: 1168 writer.write_attribute('id', obj.id) 1169 if obj.comment is not None: 1170 Writer.write_string(writer, 'comment', obj.comment) 1171 if obj.creation_date is not None: 1172 Writer.write_date(writer, 'creation_date', obj.creation_date) 1173 if obj.description is not None: 1174 Writer.write_string(writer, 'description', obj.description) 1175 if obj.name is not None: 1176 Writer.write_string(writer, 'name', obj.name) 1177 if obj.parent_id is not None: 1178 Writer.write_string(writer, 'parent_id', obj.parent_id) 1179 if obj.state is not None: 1180 Writer.write_string(writer, 'state', obj.state.value) 1181 if obj.disks is not None: 1182 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 1183 if obj.vm is not None: 1184 VmWriter.write_one(obj.vm, writer, 'vm') 1185 writer.write_end() 1186 1187 @staticmethod 1188 def write_many(objs, writer, singular=None, plural=None): 1189 if singular is None: 1190 singular = 'checkpoint' 1191 if plural is None: 1192 plural = 'checkpoints' 1193 writer.write_start(plural) 1194 if isinstance(objs, List): 1195 href = objs.href 1196 if href is not None: 1197 writer.write_attribute('href', href) 1198 for obj in objs: 1199 CheckpointWriter.write_one(obj, writer, singular) 1200 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1159 @staticmethod 1160 def write_one(obj, writer, singular=None): 1161 if singular is None: 1162 singular = 'checkpoint' 1163 writer.write_start(singular) 1164 href = obj.href 1165 if href is not None: 1166 writer.write_attribute('href', href) 1167 if obj.id is not None: 1168 writer.write_attribute('id', obj.id) 1169 if obj.comment is not None: 1170 Writer.write_string(writer, 'comment', obj.comment) 1171 if obj.creation_date is not None: 1172 Writer.write_date(writer, 'creation_date', obj.creation_date) 1173 if obj.description is not None: 1174 Writer.write_string(writer, 'description', obj.description) 1175 if obj.name is not None: 1176 Writer.write_string(writer, 'name', obj.name) 1177 if obj.parent_id is not None: 1178 Writer.write_string(writer, 'parent_id', obj.parent_id) 1179 if obj.state is not None: 1180 Writer.write_string(writer, 'state', obj.state.value) 1181 if obj.disks is not None: 1182 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 1183 if obj.vm is not None: 1184 VmWriter.write_one(obj.vm, writer, 'vm') 1185 writer.write_end()
1187 @staticmethod 1188 def write_many(objs, writer, singular=None, plural=None): 1189 if singular is None: 1190 singular = 'checkpoint' 1191 if plural is None: 1192 plural = 'checkpoints' 1193 writer.write_start(plural) 1194 if isinstance(objs, List): 1195 href = objs.href 1196 if href is not None: 1197 writer.write_attribute('href', href) 1198 for obj in objs: 1199 CheckpointWriter.write_one(obj, writer, singular) 1200 writer.write_end()
1203class CloudInitWriter(Writer): 1204 1205 def __init__(self): 1206 super(CloudInitWriter, self).__init__() 1207 1208 @staticmethod 1209 def write_one(obj, writer, singular=None): 1210 if singular is None: 1211 singular = 'cloud_init' 1212 writer.write_start(singular) 1213 href = obj.href 1214 if href is not None: 1215 writer.write_attribute('href', href) 1216 if obj.authorized_keys is not None: 1217 AuthorizedKeyWriter.write_many(obj.authorized_keys, writer, 'authorized_key', 'authorized_keys') 1218 if obj.files is not None: 1219 FileWriter.write_many(obj.files, writer, 'file', 'files') 1220 if obj.host is not None: 1221 HostWriter.write_one(obj.host, writer, 'host') 1222 if obj.network_configuration is not None: 1223 NetworkConfigurationWriter.write_one(obj.network_configuration, writer, 'network_configuration') 1224 if obj.regenerate_ssh_keys is not None: 1225 Writer.write_boolean(writer, 'regenerate_ssh_keys', obj.regenerate_ssh_keys) 1226 if obj.timezone is not None: 1227 Writer.write_string(writer, 'timezone', obj.timezone) 1228 if obj.users is not None: 1229 UserWriter.write_many(obj.users, writer, 'user', 'users') 1230 writer.write_end() 1231 1232 @staticmethod 1233 def write_many(objs, writer, singular=None, plural=None): 1234 if singular is None: 1235 singular = 'cloud_init' 1236 if plural is None: 1237 plural = 'cloud_inits' 1238 writer.write_start(plural) 1239 if isinstance(objs, List): 1240 href = objs.href 1241 if href is not None: 1242 writer.write_attribute('href', href) 1243 for obj in objs: 1244 CloudInitWriter.write_one(obj, writer, singular) 1245 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1208 @staticmethod 1209 def write_one(obj, writer, singular=None): 1210 if singular is None: 1211 singular = 'cloud_init' 1212 writer.write_start(singular) 1213 href = obj.href 1214 if href is not None: 1215 writer.write_attribute('href', href) 1216 if obj.authorized_keys is not None: 1217 AuthorizedKeyWriter.write_many(obj.authorized_keys, writer, 'authorized_key', 'authorized_keys') 1218 if obj.files is not None: 1219 FileWriter.write_many(obj.files, writer, 'file', 'files') 1220 if obj.host is not None: 1221 HostWriter.write_one(obj.host, writer, 'host') 1222 if obj.network_configuration is not None: 1223 NetworkConfigurationWriter.write_one(obj.network_configuration, writer, 'network_configuration') 1224 if obj.regenerate_ssh_keys is not None: 1225 Writer.write_boolean(writer, 'regenerate_ssh_keys', obj.regenerate_ssh_keys) 1226 if obj.timezone is not None: 1227 Writer.write_string(writer, 'timezone', obj.timezone) 1228 if obj.users is not None: 1229 UserWriter.write_many(obj.users, writer, 'user', 'users') 1230 writer.write_end()
1232 @staticmethod 1233 def write_many(objs, writer, singular=None, plural=None): 1234 if singular is None: 1235 singular = 'cloud_init' 1236 if plural is None: 1237 plural = 'cloud_inits' 1238 writer.write_start(plural) 1239 if isinstance(objs, List): 1240 href = objs.href 1241 if href is not None: 1242 writer.write_attribute('href', href) 1243 for obj in objs: 1244 CloudInitWriter.write_one(obj, writer, singular) 1245 writer.write_end()
1248class ClusterWriter(Writer): 1249 1250 def __init__(self): 1251 super(ClusterWriter, self).__init__() 1252 1253 @staticmethod 1254 def write_one(obj, writer, singular=None): 1255 if singular is None: 1256 singular = 'cluster' 1257 writer.write_start(singular) 1258 href = obj.href 1259 if href is not None: 1260 writer.write_attribute('href', href) 1261 if obj.id is not None: 1262 writer.write_attribute('id', obj.id) 1263 if obj.ballooning_enabled is not None: 1264 Writer.write_boolean(writer, 'ballooning_enabled', obj.ballooning_enabled) 1265 if obj.bios_type is not None: 1266 Writer.write_string(writer, 'bios_type', obj.bios_type.value) 1267 if obj.comment is not None: 1268 Writer.write_string(writer, 'comment', obj.comment) 1269 if obj.cpu is not None: 1270 CpuWriter.write_one(obj.cpu, writer, 'cpu') 1271 if obj.custom_scheduling_policy_properties is not None: 1272 PropertyWriter.write_many(obj.custom_scheduling_policy_properties, writer, 'property', 'custom_scheduling_policy_properties') 1273 if obj.description is not None: 1274 Writer.write_string(writer, 'description', obj.description) 1275 if obj.display is not None: 1276 DisplayWriter.write_one(obj.display, writer, 'display') 1277 if obj.error_handling is not None: 1278 ErrorHandlingWriter.write_one(obj.error_handling, writer, 'error_handling') 1279 if obj.fencing_policy is not None: 1280 FencingPolicyWriter.write_one(obj.fencing_policy, writer, 'fencing_policy') 1281 if obj.fips_mode is not None: 1282 Writer.write_string(writer, 'fips_mode', obj.fips_mode.value) 1283 if obj.firewall_type is not None: 1284 Writer.write_string(writer, 'firewall_type', obj.firewall_type.value) 1285 if obj.gluster_service is not None: 1286 Writer.write_boolean(writer, 'gluster_service', obj.gluster_service) 1287 if obj.gluster_tuned_profile is not None: 1288 Writer.write_string(writer, 'gluster_tuned_profile', obj.gluster_tuned_profile) 1289 if obj.ha_reservation is not None: 1290 Writer.write_boolean(writer, 'ha_reservation', obj.ha_reservation) 1291 if obj.ksm is not None: 1292 KsmWriter.write_one(obj.ksm, writer, 'ksm') 1293 if obj.log_max_memory_used_threshold is not None: 1294 Writer.write_integer(writer, 'log_max_memory_used_threshold', obj.log_max_memory_used_threshold) 1295 if obj.log_max_memory_used_threshold_type is not None: 1296 Writer.write_string(writer, 'log_max_memory_used_threshold_type', obj.log_max_memory_used_threshold_type.value) 1297 if obj.maintenance_reason_required is not None: 1298 Writer.write_boolean(writer, 'maintenance_reason_required', obj.maintenance_reason_required) 1299 if obj.memory_policy is not None: 1300 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 1301 if obj.migration is not None: 1302 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 1303 if obj.name is not None: 1304 Writer.write_string(writer, 'name', obj.name) 1305 if obj.optional_reason is not None: 1306 Writer.write_boolean(writer, 'optional_reason', obj.optional_reason) 1307 if obj.required_rng_sources is not None: 1308 writer.write_start('required_rng_sources') 1309 for item in obj.required_rng_sources: 1310 if item is not None: 1311 Writer.write_string(writer, 'required_rng_source', item.value) 1312 writer.write_end() 1313 if obj.serial_number is not None: 1314 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 1315 if obj.supported_versions is not None: 1316 VersionWriter.write_many(obj.supported_versions, writer, 'version', 'supported_versions') 1317 if obj.switch_type is not None: 1318 Writer.write_string(writer, 'switch_type', obj.switch_type.value) 1319 if obj.threads_as_cores is not None: 1320 Writer.write_boolean(writer, 'threads_as_cores', obj.threads_as_cores) 1321 if obj.trusted_service is not None: 1322 Writer.write_boolean(writer, 'trusted_service', obj.trusted_service) 1323 if obj.tunnel_migration is not None: 1324 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 1325 if obj.upgrade_correlation_id is not None: 1326 Writer.write_string(writer, 'upgrade_correlation_id', obj.upgrade_correlation_id) 1327 if obj.upgrade_in_progress is not None: 1328 Writer.write_boolean(writer, 'upgrade_in_progress', obj.upgrade_in_progress) 1329 if obj.upgrade_percent_complete is not None: 1330 Writer.write_integer(writer, 'upgrade_percent_complete', obj.upgrade_percent_complete) 1331 if obj.version is not None: 1332 VersionWriter.write_one(obj.version, writer, 'version') 1333 if obj.virt_service is not None: 1334 Writer.write_boolean(writer, 'virt_service', obj.virt_service) 1335 if obj.vnc_encryption is not None: 1336 Writer.write_boolean(writer, 'vnc_encryption', obj.vnc_encryption) 1337 if obj.affinity_groups is not None: 1338 AffinityGroupWriter.write_many(obj.affinity_groups, writer, 'affinity_group', 'affinity_groups') 1339 if obj.cpu_profiles is not None: 1340 CpuProfileWriter.write_many(obj.cpu_profiles, writer, 'cpu_profile', 'cpu_profiles') 1341 if obj.data_center is not None: 1342 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 1343 if obj.enabled_features is not None: 1344 ClusterFeatureWriter.write_many(obj.enabled_features, writer, 'cluster_feature', 'enabled_features') 1345 if obj.external_network_providers is not None: 1346 ExternalProviderWriter.write_many(obj.external_network_providers, writer, 'external_provider', 'external_network_providers') 1347 if obj.gluster_hooks is not None: 1348 GlusterHookWriter.write_many(obj.gluster_hooks, writer, 'gluster_hook', 'gluster_hooks') 1349 if obj.gluster_volumes is not None: 1350 GlusterVolumeWriter.write_many(obj.gluster_volumes, writer, 'gluster_volume', 'gluster_volumes') 1351 if obj.mac_pool is not None: 1352 MacPoolWriter.write_one(obj.mac_pool, writer, 'mac_pool') 1353 if obj.management_network is not None: 1354 NetworkWriter.write_one(obj.management_network, writer, 'management_network') 1355 if obj.network_filters is not None: 1356 NetworkFilterWriter.write_many(obj.network_filters, writer, 'network_filter', 'network_filters') 1357 if obj.networks is not None: 1358 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 1359 if obj.permissions is not None: 1360 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1361 if obj.scheduling_policy is not None: 1362 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 1363 writer.write_end() 1364 1365 @staticmethod 1366 def write_many(objs, writer, singular=None, plural=None): 1367 if singular is None: 1368 singular = 'cluster' 1369 if plural is None: 1370 plural = 'clusters' 1371 writer.write_start(plural) 1372 if isinstance(objs, List): 1373 href = objs.href 1374 if href is not None: 1375 writer.write_attribute('href', href) 1376 for obj in objs: 1377 ClusterWriter.write_one(obj, writer, singular) 1378 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1253 @staticmethod 1254 def write_one(obj, writer, singular=None): 1255 if singular is None: 1256 singular = 'cluster' 1257 writer.write_start(singular) 1258 href = obj.href 1259 if href is not None: 1260 writer.write_attribute('href', href) 1261 if obj.id is not None: 1262 writer.write_attribute('id', obj.id) 1263 if obj.ballooning_enabled is not None: 1264 Writer.write_boolean(writer, 'ballooning_enabled', obj.ballooning_enabled) 1265 if obj.bios_type is not None: 1266 Writer.write_string(writer, 'bios_type', obj.bios_type.value) 1267 if obj.comment is not None: 1268 Writer.write_string(writer, 'comment', obj.comment) 1269 if obj.cpu is not None: 1270 CpuWriter.write_one(obj.cpu, writer, 'cpu') 1271 if obj.custom_scheduling_policy_properties is not None: 1272 PropertyWriter.write_many(obj.custom_scheduling_policy_properties, writer, 'property', 'custom_scheduling_policy_properties') 1273 if obj.description is not None: 1274 Writer.write_string(writer, 'description', obj.description) 1275 if obj.display is not None: 1276 DisplayWriter.write_one(obj.display, writer, 'display') 1277 if obj.error_handling is not None: 1278 ErrorHandlingWriter.write_one(obj.error_handling, writer, 'error_handling') 1279 if obj.fencing_policy is not None: 1280 FencingPolicyWriter.write_one(obj.fencing_policy, writer, 'fencing_policy') 1281 if obj.fips_mode is not None: 1282 Writer.write_string(writer, 'fips_mode', obj.fips_mode.value) 1283 if obj.firewall_type is not None: 1284 Writer.write_string(writer, 'firewall_type', obj.firewall_type.value) 1285 if obj.gluster_service is not None: 1286 Writer.write_boolean(writer, 'gluster_service', obj.gluster_service) 1287 if obj.gluster_tuned_profile is not None: 1288 Writer.write_string(writer, 'gluster_tuned_profile', obj.gluster_tuned_profile) 1289 if obj.ha_reservation is not None: 1290 Writer.write_boolean(writer, 'ha_reservation', obj.ha_reservation) 1291 if obj.ksm is not None: 1292 KsmWriter.write_one(obj.ksm, writer, 'ksm') 1293 if obj.log_max_memory_used_threshold is not None: 1294 Writer.write_integer(writer, 'log_max_memory_used_threshold', obj.log_max_memory_used_threshold) 1295 if obj.log_max_memory_used_threshold_type is not None: 1296 Writer.write_string(writer, 'log_max_memory_used_threshold_type', obj.log_max_memory_used_threshold_type.value) 1297 if obj.maintenance_reason_required is not None: 1298 Writer.write_boolean(writer, 'maintenance_reason_required', obj.maintenance_reason_required) 1299 if obj.memory_policy is not None: 1300 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 1301 if obj.migration is not None: 1302 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 1303 if obj.name is not None: 1304 Writer.write_string(writer, 'name', obj.name) 1305 if obj.optional_reason is not None: 1306 Writer.write_boolean(writer, 'optional_reason', obj.optional_reason) 1307 if obj.required_rng_sources is not None: 1308 writer.write_start('required_rng_sources') 1309 for item in obj.required_rng_sources: 1310 if item is not None: 1311 Writer.write_string(writer, 'required_rng_source', item.value) 1312 writer.write_end() 1313 if obj.serial_number is not None: 1314 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 1315 if obj.supported_versions is not None: 1316 VersionWriter.write_many(obj.supported_versions, writer, 'version', 'supported_versions') 1317 if obj.switch_type is not None: 1318 Writer.write_string(writer, 'switch_type', obj.switch_type.value) 1319 if obj.threads_as_cores is not None: 1320 Writer.write_boolean(writer, 'threads_as_cores', obj.threads_as_cores) 1321 if obj.trusted_service is not None: 1322 Writer.write_boolean(writer, 'trusted_service', obj.trusted_service) 1323 if obj.tunnel_migration is not None: 1324 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 1325 if obj.upgrade_correlation_id is not None: 1326 Writer.write_string(writer, 'upgrade_correlation_id', obj.upgrade_correlation_id) 1327 if obj.upgrade_in_progress is not None: 1328 Writer.write_boolean(writer, 'upgrade_in_progress', obj.upgrade_in_progress) 1329 if obj.upgrade_percent_complete is not None: 1330 Writer.write_integer(writer, 'upgrade_percent_complete', obj.upgrade_percent_complete) 1331 if obj.version is not None: 1332 VersionWriter.write_one(obj.version, writer, 'version') 1333 if obj.virt_service is not None: 1334 Writer.write_boolean(writer, 'virt_service', obj.virt_service) 1335 if obj.vnc_encryption is not None: 1336 Writer.write_boolean(writer, 'vnc_encryption', obj.vnc_encryption) 1337 if obj.affinity_groups is not None: 1338 AffinityGroupWriter.write_many(obj.affinity_groups, writer, 'affinity_group', 'affinity_groups') 1339 if obj.cpu_profiles is not None: 1340 CpuProfileWriter.write_many(obj.cpu_profiles, writer, 'cpu_profile', 'cpu_profiles') 1341 if obj.data_center is not None: 1342 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 1343 if obj.enabled_features is not None: 1344 ClusterFeatureWriter.write_many(obj.enabled_features, writer, 'cluster_feature', 'enabled_features') 1345 if obj.external_network_providers is not None: 1346 ExternalProviderWriter.write_many(obj.external_network_providers, writer, 'external_provider', 'external_network_providers') 1347 if obj.gluster_hooks is not None: 1348 GlusterHookWriter.write_many(obj.gluster_hooks, writer, 'gluster_hook', 'gluster_hooks') 1349 if obj.gluster_volumes is not None: 1350 GlusterVolumeWriter.write_many(obj.gluster_volumes, writer, 'gluster_volume', 'gluster_volumes') 1351 if obj.mac_pool is not None: 1352 MacPoolWriter.write_one(obj.mac_pool, writer, 'mac_pool') 1353 if obj.management_network is not None: 1354 NetworkWriter.write_one(obj.management_network, writer, 'management_network') 1355 if obj.network_filters is not None: 1356 NetworkFilterWriter.write_many(obj.network_filters, writer, 'network_filter', 'network_filters') 1357 if obj.networks is not None: 1358 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 1359 if obj.permissions is not None: 1360 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1361 if obj.scheduling_policy is not None: 1362 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 1363 writer.write_end()
1365 @staticmethod 1366 def write_many(objs, writer, singular=None, plural=None): 1367 if singular is None: 1368 singular = 'cluster' 1369 if plural is None: 1370 plural = 'clusters' 1371 writer.write_start(plural) 1372 if isinstance(objs, List): 1373 href = objs.href 1374 if href is not None: 1375 writer.write_attribute('href', href) 1376 for obj in objs: 1377 ClusterWriter.write_one(obj, writer, singular) 1378 writer.write_end()
1381class ClusterFeatureWriter(Writer): 1382 1383 def __init__(self): 1384 super(ClusterFeatureWriter, self).__init__() 1385 1386 @staticmethod 1387 def write_one(obj, writer, singular=None): 1388 if singular is None: 1389 singular = 'cluster_feature' 1390 writer.write_start(singular) 1391 href = obj.href 1392 if href is not None: 1393 writer.write_attribute('href', href) 1394 if obj.id is not None: 1395 writer.write_attribute('id', obj.id) 1396 if obj.comment is not None: 1397 Writer.write_string(writer, 'comment', obj.comment) 1398 if obj.description is not None: 1399 Writer.write_string(writer, 'description', obj.description) 1400 if obj.name is not None: 1401 Writer.write_string(writer, 'name', obj.name) 1402 if obj.cluster_level is not None: 1403 ClusterLevelWriter.write_one(obj.cluster_level, writer, 'cluster_level') 1404 writer.write_end() 1405 1406 @staticmethod 1407 def write_many(objs, writer, singular=None, plural=None): 1408 if singular is None: 1409 singular = 'cluster_feature' 1410 if plural is None: 1411 plural = 'cluster_features' 1412 writer.write_start(plural) 1413 if isinstance(objs, List): 1414 href = objs.href 1415 if href is not None: 1416 writer.write_attribute('href', href) 1417 for obj in objs: 1418 ClusterFeatureWriter.write_one(obj, writer, singular) 1419 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1386 @staticmethod 1387 def write_one(obj, writer, singular=None): 1388 if singular is None: 1389 singular = 'cluster_feature' 1390 writer.write_start(singular) 1391 href = obj.href 1392 if href is not None: 1393 writer.write_attribute('href', href) 1394 if obj.id is not None: 1395 writer.write_attribute('id', obj.id) 1396 if obj.comment is not None: 1397 Writer.write_string(writer, 'comment', obj.comment) 1398 if obj.description is not None: 1399 Writer.write_string(writer, 'description', obj.description) 1400 if obj.name is not None: 1401 Writer.write_string(writer, 'name', obj.name) 1402 if obj.cluster_level is not None: 1403 ClusterLevelWriter.write_one(obj.cluster_level, writer, 'cluster_level') 1404 writer.write_end()
1406 @staticmethod 1407 def write_many(objs, writer, singular=None, plural=None): 1408 if singular is None: 1409 singular = 'cluster_feature' 1410 if plural is None: 1411 plural = 'cluster_features' 1412 writer.write_start(plural) 1413 if isinstance(objs, List): 1414 href = objs.href 1415 if href is not None: 1416 writer.write_attribute('href', href) 1417 for obj in objs: 1418 ClusterFeatureWriter.write_one(obj, writer, singular) 1419 writer.write_end()
1422class ClusterLevelWriter(Writer): 1423 1424 def __init__(self): 1425 super(ClusterLevelWriter, self).__init__() 1426 1427 @staticmethod 1428 def write_one(obj, writer, singular=None): 1429 if singular is None: 1430 singular = 'cluster_level' 1431 writer.write_start(singular) 1432 href = obj.href 1433 if href is not None: 1434 writer.write_attribute('href', href) 1435 if obj.id is not None: 1436 writer.write_attribute('id', obj.id) 1437 if obj.comment is not None: 1438 Writer.write_string(writer, 'comment', obj.comment) 1439 if obj.cpu_types is not None: 1440 CpuTypeWriter.write_many(obj.cpu_types, writer, 'cpu_type', 'cpu_types') 1441 if obj.description is not None: 1442 Writer.write_string(writer, 'description', obj.description) 1443 if obj.name is not None: 1444 Writer.write_string(writer, 'name', obj.name) 1445 if obj.permits is not None: 1446 PermitWriter.write_many(obj.permits, writer, 'permit', 'permits') 1447 if obj.cluster_features is not None: 1448 ClusterFeatureWriter.write_many(obj.cluster_features, writer, 'cluster_feature', 'cluster_features') 1449 writer.write_end() 1450 1451 @staticmethod 1452 def write_many(objs, writer, singular=None, plural=None): 1453 if singular is None: 1454 singular = 'cluster_level' 1455 if plural is None: 1456 plural = 'cluster_levels' 1457 writer.write_start(plural) 1458 if isinstance(objs, List): 1459 href = objs.href 1460 if href is not None: 1461 writer.write_attribute('href', href) 1462 for obj in objs: 1463 ClusterLevelWriter.write_one(obj, writer, singular) 1464 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1427 @staticmethod 1428 def write_one(obj, writer, singular=None): 1429 if singular is None: 1430 singular = 'cluster_level' 1431 writer.write_start(singular) 1432 href = obj.href 1433 if href is not None: 1434 writer.write_attribute('href', href) 1435 if obj.id is not None: 1436 writer.write_attribute('id', obj.id) 1437 if obj.comment is not None: 1438 Writer.write_string(writer, 'comment', obj.comment) 1439 if obj.cpu_types is not None: 1440 CpuTypeWriter.write_many(obj.cpu_types, writer, 'cpu_type', 'cpu_types') 1441 if obj.description is not None: 1442 Writer.write_string(writer, 'description', obj.description) 1443 if obj.name is not None: 1444 Writer.write_string(writer, 'name', obj.name) 1445 if obj.permits is not None: 1446 PermitWriter.write_many(obj.permits, writer, 'permit', 'permits') 1447 if obj.cluster_features is not None: 1448 ClusterFeatureWriter.write_many(obj.cluster_features, writer, 'cluster_feature', 'cluster_features') 1449 writer.write_end()
1451 @staticmethod 1452 def write_many(objs, writer, singular=None, plural=None): 1453 if singular is None: 1454 singular = 'cluster_level' 1455 if plural is None: 1456 plural = 'cluster_levels' 1457 writer.write_start(plural) 1458 if isinstance(objs, List): 1459 href = objs.href 1460 if href is not None: 1461 writer.write_attribute('href', href) 1462 for obj in objs: 1463 ClusterLevelWriter.write_one(obj, writer, singular) 1464 writer.write_end()
1467class ConfigurationWriter(Writer): 1468 1469 def __init__(self): 1470 super(ConfigurationWriter, self).__init__() 1471 1472 @staticmethod 1473 def write_one(obj, writer, singular=None): 1474 if singular is None: 1475 singular = 'configuration' 1476 writer.write_start(singular) 1477 href = obj.href 1478 if href is not None: 1479 writer.write_attribute('href', href) 1480 if obj.data is not None: 1481 Writer.write_string(writer, 'data', obj.data) 1482 if obj.type is not None: 1483 Writer.write_string(writer, 'type', obj.type.value) 1484 writer.write_end() 1485 1486 @staticmethod 1487 def write_many(objs, writer, singular=None, plural=None): 1488 if singular is None: 1489 singular = 'configuration' 1490 if plural is None: 1491 plural = 'configurations' 1492 writer.write_start(plural) 1493 if isinstance(objs, List): 1494 href = objs.href 1495 if href is not None: 1496 writer.write_attribute('href', href) 1497 for obj in objs: 1498 ConfigurationWriter.write_one(obj, writer, singular) 1499 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1472 @staticmethod 1473 def write_one(obj, writer, singular=None): 1474 if singular is None: 1475 singular = 'configuration' 1476 writer.write_start(singular) 1477 href = obj.href 1478 if href is not None: 1479 writer.write_attribute('href', href) 1480 if obj.data is not None: 1481 Writer.write_string(writer, 'data', obj.data) 1482 if obj.type is not None: 1483 Writer.write_string(writer, 'type', obj.type.value) 1484 writer.write_end()
1486 @staticmethod 1487 def write_many(objs, writer, singular=None, plural=None): 1488 if singular is None: 1489 singular = 'configuration' 1490 if plural is None: 1491 plural = 'configurations' 1492 writer.write_start(plural) 1493 if isinstance(objs, List): 1494 href = objs.href 1495 if href is not None: 1496 writer.write_attribute('href', href) 1497 for obj in objs: 1498 ConfigurationWriter.write_one(obj, writer, singular) 1499 writer.write_end()
1502class ConsoleWriter(Writer): 1503 1504 def __init__(self): 1505 super(ConsoleWriter, self).__init__() 1506 1507 @staticmethod 1508 def write_one(obj, writer, singular=None): 1509 if singular is None: 1510 singular = 'console' 1511 writer.write_start(singular) 1512 href = obj.href 1513 if href is not None: 1514 writer.write_attribute('href', href) 1515 if obj.enabled is not None: 1516 Writer.write_boolean(writer, 'enabled', obj.enabled) 1517 writer.write_end() 1518 1519 @staticmethod 1520 def write_many(objs, writer, singular=None, plural=None): 1521 if singular is None: 1522 singular = 'console' 1523 if plural is None: 1524 plural = 'consoles' 1525 writer.write_start(plural) 1526 if isinstance(objs, List): 1527 href = objs.href 1528 if href is not None: 1529 writer.write_attribute('href', href) 1530 for obj in objs: 1531 ConsoleWriter.write_one(obj, writer, singular) 1532 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1507 @staticmethod 1508 def write_one(obj, writer, singular=None): 1509 if singular is None: 1510 singular = 'console' 1511 writer.write_start(singular) 1512 href = obj.href 1513 if href is not None: 1514 writer.write_attribute('href', href) 1515 if obj.enabled is not None: 1516 Writer.write_boolean(writer, 'enabled', obj.enabled) 1517 writer.write_end()
1519 @staticmethod 1520 def write_many(objs, writer, singular=None, plural=None): 1521 if singular is None: 1522 singular = 'console' 1523 if plural is None: 1524 plural = 'consoles' 1525 writer.write_start(plural) 1526 if isinstance(objs, List): 1527 href = objs.href 1528 if href is not None: 1529 writer.write_attribute('href', href) 1530 for obj in objs: 1531 ConsoleWriter.write_one(obj, writer, singular) 1532 writer.write_end()
1535class CoreWriter(Writer): 1536 1537 def __init__(self): 1538 super(CoreWriter, self).__init__() 1539 1540 @staticmethod 1541 def write_one(obj, writer, singular=None): 1542 if singular is None: 1543 singular = 'core' 1544 writer.write_start(singular) 1545 href = obj.href 1546 if href is not None: 1547 writer.write_attribute('href', href) 1548 if obj.index is not None: 1549 Writer.write_integer(writer, 'index', obj.index) 1550 if obj.socket is not None: 1551 Writer.write_integer(writer, 'socket', obj.socket) 1552 writer.write_end() 1553 1554 @staticmethod 1555 def write_many(objs, writer, singular=None, plural=None): 1556 if singular is None: 1557 singular = 'core' 1558 if plural is None: 1559 plural = 'cores' 1560 writer.write_start(plural) 1561 if isinstance(objs, List): 1562 href = objs.href 1563 if href is not None: 1564 writer.write_attribute('href', href) 1565 for obj in objs: 1566 CoreWriter.write_one(obj, writer, singular) 1567 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1540 @staticmethod 1541 def write_one(obj, writer, singular=None): 1542 if singular is None: 1543 singular = 'core' 1544 writer.write_start(singular) 1545 href = obj.href 1546 if href is not None: 1547 writer.write_attribute('href', href) 1548 if obj.index is not None: 1549 Writer.write_integer(writer, 'index', obj.index) 1550 if obj.socket is not None: 1551 Writer.write_integer(writer, 'socket', obj.socket) 1552 writer.write_end()
1554 @staticmethod 1555 def write_many(objs, writer, singular=None, plural=None): 1556 if singular is None: 1557 singular = 'core' 1558 if plural is None: 1559 plural = 'cores' 1560 writer.write_start(plural) 1561 if isinstance(objs, List): 1562 href = objs.href 1563 if href is not None: 1564 writer.write_attribute('href', href) 1565 for obj in objs: 1566 CoreWriter.write_one(obj, writer, singular) 1567 writer.write_end()
1570class CpuWriter(Writer): 1571 1572 def __init__(self): 1573 super(CpuWriter, self).__init__() 1574 1575 @staticmethod 1576 def write_one(obj, writer, singular=None): 1577 if singular is None: 1578 singular = 'cpu' 1579 writer.write_start(singular) 1580 href = obj.href 1581 if href is not None: 1582 writer.write_attribute('href', href) 1583 if obj.architecture is not None: 1584 Writer.write_string(writer, 'architecture', obj.architecture.value) 1585 if obj.cores is not None: 1586 CoreWriter.write_many(obj.cores, writer, 'core', 'cores') 1587 if obj.cpu_tune is not None: 1588 CpuTuneWriter.write_one(obj.cpu_tune, writer, 'cpu_tune') 1589 if obj.level is not None: 1590 Writer.write_integer(writer, 'level', obj.level) 1591 if obj.mode is not None: 1592 Writer.write_string(writer, 'mode', obj.mode.value) 1593 if obj.name is not None: 1594 Writer.write_string(writer, 'name', obj.name) 1595 if obj.speed is not None: 1596 Writer.write_decimal(writer, 'speed', obj.speed) 1597 if obj.topology is not None: 1598 CpuTopologyWriter.write_one(obj.topology, writer, 'topology') 1599 if obj.type is not None: 1600 Writer.write_string(writer, 'type', obj.type) 1601 writer.write_end() 1602 1603 @staticmethod 1604 def write_many(objs, writer, singular=None, plural=None): 1605 if singular is None: 1606 singular = 'cpu' 1607 if plural is None: 1608 plural = 'cpus' 1609 writer.write_start(plural) 1610 if isinstance(objs, List): 1611 href = objs.href 1612 if href is not None: 1613 writer.write_attribute('href', href) 1614 for obj in objs: 1615 CpuWriter.write_one(obj, writer, singular) 1616 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1575 @staticmethod 1576 def write_one(obj, writer, singular=None): 1577 if singular is None: 1578 singular = 'cpu' 1579 writer.write_start(singular) 1580 href = obj.href 1581 if href is not None: 1582 writer.write_attribute('href', href) 1583 if obj.architecture is not None: 1584 Writer.write_string(writer, 'architecture', obj.architecture.value) 1585 if obj.cores is not None: 1586 CoreWriter.write_many(obj.cores, writer, 'core', 'cores') 1587 if obj.cpu_tune is not None: 1588 CpuTuneWriter.write_one(obj.cpu_tune, writer, 'cpu_tune') 1589 if obj.level is not None: 1590 Writer.write_integer(writer, 'level', obj.level) 1591 if obj.mode is not None: 1592 Writer.write_string(writer, 'mode', obj.mode.value) 1593 if obj.name is not None: 1594 Writer.write_string(writer, 'name', obj.name) 1595 if obj.speed is not None: 1596 Writer.write_decimal(writer, 'speed', obj.speed) 1597 if obj.topology is not None: 1598 CpuTopologyWriter.write_one(obj.topology, writer, 'topology') 1599 if obj.type is not None: 1600 Writer.write_string(writer, 'type', obj.type) 1601 writer.write_end()
1603 @staticmethod 1604 def write_many(objs, writer, singular=None, plural=None): 1605 if singular is None: 1606 singular = 'cpu' 1607 if plural is None: 1608 plural = 'cpus' 1609 writer.write_start(plural) 1610 if isinstance(objs, List): 1611 href = objs.href 1612 if href is not None: 1613 writer.write_attribute('href', href) 1614 for obj in objs: 1615 CpuWriter.write_one(obj, writer, singular) 1616 writer.write_end()
1619class CpuProfileWriter(Writer): 1620 1621 def __init__(self): 1622 super(CpuProfileWriter, self).__init__() 1623 1624 @staticmethod 1625 def write_one(obj, writer, singular=None): 1626 if singular is None: 1627 singular = 'cpu_profile' 1628 writer.write_start(singular) 1629 href = obj.href 1630 if href is not None: 1631 writer.write_attribute('href', href) 1632 if obj.id is not None: 1633 writer.write_attribute('id', obj.id) 1634 if obj.comment is not None: 1635 Writer.write_string(writer, 'comment', obj.comment) 1636 if obj.description is not None: 1637 Writer.write_string(writer, 'description', obj.description) 1638 if obj.name is not None: 1639 Writer.write_string(writer, 'name', obj.name) 1640 if obj.cluster is not None: 1641 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 1642 if obj.permissions is not None: 1643 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1644 if obj.qos is not None: 1645 QosWriter.write_one(obj.qos, writer, 'qos') 1646 writer.write_end() 1647 1648 @staticmethod 1649 def write_many(objs, writer, singular=None, plural=None): 1650 if singular is None: 1651 singular = 'cpu_profile' 1652 if plural is None: 1653 plural = 'cpu_profiles' 1654 writer.write_start(plural) 1655 if isinstance(objs, List): 1656 href = objs.href 1657 if href is not None: 1658 writer.write_attribute('href', href) 1659 for obj in objs: 1660 CpuProfileWriter.write_one(obj, writer, singular) 1661 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1624 @staticmethod 1625 def write_one(obj, writer, singular=None): 1626 if singular is None: 1627 singular = 'cpu_profile' 1628 writer.write_start(singular) 1629 href = obj.href 1630 if href is not None: 1631 writer.write_attribute('href', href) 1632 if obj.id is not None: 1633 writer.write_attribute('id', obj.id) 1634 if obj.comment is not None: 1635 Writer.write_string(writer, 'comment', obj.comment) 1636 if obj.description is not None: 1637 Writer.write_string(writer, 'description', obj.description) 1638 if obj.name is not None: 1639 Writer.write_string(writer, 'name', obj.name) 1640 if obj.cluster is not None: 1641 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 1642 if obj.permissions is not None: 1643 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1644 if obj.qos is not None: 1645 QosWriter.write_one(obj.qos, writer, 'qos') 1646 writer.write_end()
1648 @staticmethod 1649 def write_many(objs, writer, singular=None, plural=None): 1650 if singular is None: 1651 singular = 'cpu_profile' 1652 if plural is None: 1653 plural = 'cpu_profiles' 1654 writer.write_start(plural) 1655 if isinstance(objs, List): 1656 href = objs.href 1657 if href is not None: 1658 writer.write_attribute('href', href) 1659 for obj in objs: 1660 CpuProfileWriter.write_one(obj, writer, singular) 1661 writer.write_end()
1664class CpuTopologyWriter(Writer): 1665 1666 def __init__(self): 1667 super(CpuTopologyWriter, self).__init__() 1668 1669 @staticmethod 1670 def write_one(obj, writer, singular=None): 1671 if singular is None: 1672 singular = 'cpu_topology' 1673 writer.write_start(singular) 1674 href = obj.href 1675 if href is not None: 1676 writer.write_attribute('href', href) 1677 if obj.cores is not None: 1678 Writer.write_integer(writer, 'cores', obj.cores) 1679 if obj.sockets is not None: 1680 Writer.write_integer(writer, 'sockets', obj.sockets) 1681 if obj.threads is not None: 1682 Writer.write_integer(writer, 'threads', obj.threads) 1683 writer.write_end() 1684 1685 @staticmethod 1686 def write_many(objs, writer, singular=None, plural=None): 1687 if singular is None: 1688 singular = 'cpu_topology' 1689 if plural is None: 1690 plural = 'cpu_topologies' 1691 writer.write_start(plural) 1692 if isinstance(objs, List): 1693 href = objs.href 1694 if href is not None: 1695 writer.write_attribute('href', href) 1696 for obj in objs: 1697 CpuTopologyWriter.write_one(obj, writer, singular) 1698 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1669 @staticmethod 1670 def write_one(obj, writer, singular=None): 1671 if singular is None: 1672 singular = 'cpu_topology' 1673 writer.write_start(singular) 1674 href = obj.href 1675 if href is not None: 1676 writer.write_attribute('href', href) 1677 if obj.cores is not None: 1678 Writer.write_integer(writer, 'cores', obj.cores) 1679 if obj.sockets is not None: 1680 Writer.write_integer(writer, 'sockets', obj.sockets) 1681 if obj.threads is not None: 1682 Writer.write_integer(writer, 'threads', obj.threads) 1683 writer.write_end()
1685 @staticmethod 1686 def write_many(objs, writer, singular=None, plural=None): 1687 if singular is None: 1688 singular = 'cpu_topology' 1689 if plural is None: 1690 plural = 'cpu_topologies' 1691 writer.write_start(plural) 1692 if isinstance(objs, List): 1693 href = objs.href 1694 if href is not None: 1695 writer.write_attribute('href', href) 1696 for obj in objs: 1697 CpuTopologyWriter.write_one(obj, writer, singular) 1698 writer.write_end()
1701class CpuTuneWriter(Writer): 1702 1703 def __init__(self): 1704 super(CpuTuneWriter, self).__init__() 1705 1706 @staticmethod 1707 def write_one(obj, writer, singular=None): 1708 if singular is None: 1709 singular = 'cpu_tune' 1710 writer.write_start(singular) 1711 href = obj.href 1712 if href is not None: 1713 writer.write_attribute('href', href) 1714 if obj.vcpu_pins is not None: 1715 VcpuPinWriter.write_many(obj.vcpu_pins, writer, 'vcpu_pin', 'vcpu_pins') 1716 writer.write_end() 1717 1718 @staticmethod 1719 def write_many(objs, writer, singular=None, plural=None): 1720 if singular is None: 1721 singular = 'cpu_tune' 1722 if plural is None: 1723 plural = 'cpu_tunes' 1724 writer.write_start(plural) 1725 if isinstance(objs, List): 1726 href = objs.href 1727 if href is not None: 1728 writer.write_attribute('href', href) 1729 for obj in objs: 1730 CpuTuneWriter.write_one(obj, writer, singular) 1731 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1706 @staticmethod 1707 def write_one(obj, writer, singular=None): 1708 if singular is None: 1709 singular = 'cpu_tune' 1710 writer.write_start(singular) 1711 href = obj.href 1712 if href is not None: 1713 writer.write_attribute('href', href) 1714 if obj.vcpu_pins is not None: 1715 VcpuPinWriter.write_many(obj.vcpu_pins, writer, 'vcpu_pin', 'vcpu_pins') 1716 writer.write_end()
1718 @staticmethod 1719 def write_many(objs, writer, singular=None, plural=None): 1720 if singular is None: 1721 singular = 'cpu_tune' 1722 if plural is None: 1723 plural = 'cpu_tunes' 1724 writer.write_start(plural) 1725 if isinstance(objs, List): 1726 href = objs.href 1727 if href is not None: 1728 writer.write_attribute('href', href) 1729 for obj in objs: 1730 CpuTuneWriter.write_one(obj, writer, singular) 1731 writer.write_end()
1734class CpuTypeWriter(Writer): 1735 1736 def __init__(self): 1737 super(CpuTypeWriter, self).__init__() 1738 1739 @staticmethod 1740 def write_one(obj, writer, singular=None): 1741 if singular is None: 1742 singular = 'cpu_type' 1743 writer.write_start(singular) 1744 href = obj.href 1745 if href is not None: 1746 writer.write_attribute('href', href) 1747 if obj.architecture is not None: 1748 Writer.write_string(writer, 'architecture', obj.architecture.value) 1749 if obj.level is not None: 1750 Writer.write_integer(writer, 'level', obj.level) 1751 if obj.name is not None: 1752 Writer.write_string(writer, 'name', obj.name) 1753 writer.write_end() 1754 1755 @staticmethod 1756 def write_many(objs, writer, singular=None, plural=None): 1757 if singular is None: 1758 singular = 'cpu_type' 1759 if plural is None: 1760 plural = 'cpu_types' 1761 writer.write_start(plural) 1762 if isinstance(objs, List): 1763 href = objs.href 1764 if href is not None: 1765 writer.write_attribute('href', href) 1766 for obj in objs: 1767 CpuTypeWriter.write_one(obj, writer, singular) 1768 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1739 @staticmethod 1740 def write_one(obj, writer, singular=None): 1741 if singular is None: 1742 singular = 'cpu_type' 1743 writer.write_start(singular) 1744 href = obj.href 1745 if href is not None: 1746 writer.write_attribute('href', href) 1747 if obj.architecture is not None: 1748 Writer.write_string(writer, 'architecture', obj.architecture.value) 1749 if obj.level is not None: 1750 Writer.write_integer(writer, 'level', obj.level) 1751 if obj.name is not None: 1752 Writer.write_string(writer, 'name', obj.name) 1753 writer.write_end()
1755 @staticmethod 1756 def write_many(objs, writer, singular=None, plural=None): 1757 if singular is None: 1758 singular = 'cpu_type' 1759 if plural is None: 1760 plural = 'cpu_types' 1761 writer.write_start(plural) 1762 if isinstance(objs, List): 1763 href = objs.href 1764 if href is not None: 1765 writer.write_attribute('href', href) 1766 for obj in objs: 1767 CpuTypeWriter.write_one(obj, writer, singular) 1768 writer.write_end()
1771class CustomPropertyWriter(Writer): 1772 1773 def __init__(self): 1774 super(CustomPropertyWriter, self).__init__() 1775 1776 @staticmethod 1777 def write_one(obj, writer, singular=None): 1778 if singular is None: 1779 singular = 'custom_property' 1780 writer.write_start(singular) 1781 href = obj.href 1782 if href is not None: 1783 writer.write_attribute('href', href) 1784 if obj.name is not None: 1785 Writer.write_string(writer, 'name', obj.name) 1786 if obj.regexp is not None: 1787 Writer.write_string(writer, 'regexp', obj.regexp) 1788 if obj.value is not None: 1789 Writer.write_string(writer, 'value', obj.value) 1790 writer.write_end() 1791 1792 @staticmethod 1793 def write_many(objs, writer, singular=None, plural=None): 1794 if singular is None: 1795 singular = 'custom_property' 1796 if plural is None: 1797 plural = 'custom_properties' 1798 writer.write_start(plural) 1799 if isinstance(objs, List): 1800 href = objs.href 1801 if href is not None: 1802 writer.write_attribute('href', href) 1803 for obj in objs: 1804 CustomPropertyWriter.write_one(obj, writer, singular) 1805 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1776 @staticmethod 1777 def write_one(obj, writer, singular=None): 1778 if singular is None: 1779 singular = 'custom_property' 1780 writer.write_start(singular) 1781 href = obj.href 1782 if href is not None: 1783 writer.write_attribute('href', href) 1784 if obj.name is not None: 1785 Writer.write_string(writer, 'name', obj.name) 1786 if obj.regexp is not None: 1787 Writer.write_string(writer, 'regexp', obj.regexp) 1788 if obj.value is not None: 1789 Writer.write_string(writer, 'value', obj.value) 1790 writer.write_end()
1792 @staticmethod 1793 def write_many(objs, writer, singular=None, plural=None): 1794 if singular is None: 1795 singular = 'custom_property' 1796 if plural is None: 1797 plural = 'custom_properties' 1798 writer.write_start(plural) 1799 if isinstance(objs, List): 1800 href = objs.href 1801 if href is not None: 1802 writer.write_attribute('href', href) 1803 for obj in objs: 1804 CustomPropertyWriter.write_one(obj, writer, singular) 1805 writer.write_end()
1808class DataCenterWriter(Writer): 1809 1810 def __init__(self): 1811 super(DataCenterWriter, self).__init__() 1812 1813 @staticmethod 1814 def write_one(obj, writer, singular=None): 1815 if singular is None: 1816 singular = 'data_center' 1817 writer.write_start(singular) 1818 href = obj.href 1819 if href is not None: 1820 writer.write_attribute('href', href) 1821 if obj.id is not None: 1822 writer.write_attribute('id', obj.id) 1823 if obj.comment is not None: 1824 Writer.write_string(writer, 'comment', obj.comment) 1825 if obj.description is not None: 1826 Writer.write_string(writer, 'description', obj.description) 1827 if obj.local is not None: 1828 Writer.write_boolean(writer, 'local', obj.local) 1829 if obj.name is not None: 1830 Writer.write_string(writer, 'name', obj.name) 1831 if obj.quota_mode is not None: 1832 Writer.write_string(writer, 'quota_mode', obj.quota_mode.value) 1833 if obj.status is not None: 1834 Writer.write_string(writer, 'status', obj.status.value) 1835 if obj.storage_format is not None: 1836 Writer.write_string(writer, 'storage_format', obj.storage_format.value) 1837 if obj.supported_versions is not None: 1838 VersionWriter.write_many(obj.supported_versions, writer, 'version', 'supported_versions') 1839 if obj.version is not None: 1840 VersionWriter.write_one(obj.version, writer, 'version') 1841 if obj.clusters is not None: 1842 ClusterWriter.write_many(obj.clusters, writer, 'cluster', 'clusters') 1843 if obj.iscsi_bonds is not None: 1844 IscsiBondWriter.write_many(obj.iscsi_bonds, writer, 'iscsi_bond', 'iscsi_bonds') 1845 if obj.mac_pool is not None: 1846 MacPoolWriter.write_one(obj.mac_pool, writer, 'mac_pool') 1847 if obj.networks is not None: 1848 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 1849 if obj.permissions is not None: 1850 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1851 if obj.qoss is not None: 1852 QosWriter.write_many(obj.qoss, writer, 'qos', 'qoss') 1853 if obj.quotas is not None: 1854 QuotaWriter.write_many(obj.quotas, writer, 'quota', 'quotas') 1855 if obj.storage_domains is not None: 1856 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 1857 writer.write_end() 1858 1859 @staticmethod 1860 def write_many(objs, writer, singular=None, plural=None): 1861 if singular is None: 1862 singular = 'data_center' 1863 if plural is None: 1864 plural = 'data_centers' 1865 writer.write_start(plural) 1866 if isinstance(objs, List): 1867 href = objs.href 1868 if href is not None: 1869 writer.write_attribute('href', href) 1870 for obj in objs: 1871 DataCenterWriter.write_one(obj, writer, singular) 1872 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1813 @staticmethod 1814 def write_one(obj, writer, singular=None): 1815 if singular is None: 1816 singular = 'data_center' 1817 writer.write_start(singular) 1818 href = obj.href 1819 if href is not None: 1820 writer.write_attribute('href', href) 1821 if obj.id is not None: 1822 writer.write_attribute('id', obj.id) 1823 if obj.comment is not None: 1824 Writer.write_string(writer, 'comment', obj.comment) 1825 if obj.description is not None: 1826 Writer.write_string(writer, 'description', obj.description) 1827 if obj.local is not None: 1828 Writer.write_boolean(writer, 'local', obj.local) 1829 if obj.name is not None: 1830 Writer.write_string(writer, 'name', obj.name) 1831 if obj.quota_mode is not None: 1832 Writer.write_string(writer, 'quota_mode', obj.quota_mode.value) 1833 if obj.status is not None: 1834 Writer.write_string(writer, 'status', obj.status.value) 1835 if obj.storage_format is not None: 1836 Writer.write_string(writer, 'storage_format', obj.storage_format.value) 1837 if obj.supported_versions is not None: 1838 VersionWriter.write_many(obj.supported_versions, writer, 'version', 'supported_versions') 1839 if obj.version is not None: 1840 VersionWriter.write_one(obj.version, writer, 'version') 1841 if obj.clusters is not None: 1842 ClusterWriter.write_many(obj.clusters, writer, 'cluster', 'clusters') 1843 if obj.iscsi_bonds is not None: 1844 IscsiBondWriter.write_many(obj.iscsi_bonds, writer, 'iscsi_bond', 'iscsi_bonds') 1845 if obj.mac_pool is not None: 1846 MacPoolWriter.write_one(obj.mac_pool, writer, 'mac_pool') 1847 if obj.networks is not None: 1848 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 1849 if obj.permissions is not None: 1850 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 1851 if obj.qoss is not None: 1852 QosWriter.write_many(obj.qoss, writer, 'qos', 'qoss') 1853 if obj.quotas is not None: 1854 QuotaWriter.write_many(obj.quotas, writer, 'quota', 'quotas') 1855 if obj.storage_domains is not None: 1856 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 1857 writer.write_end()
1859 @staticmethod 1860 def write_many(objs, writer, singular=None, plural=None): 1861 if singular is None: 1862 singular = 'data_center' 1863 if plural is None: 1864 plural = 'data_centers' 1865 writer.write_start(plural) 1866 if isinstance(objs, List): 1867 href = objs.href 1868 if href is not None: 1869 writer.write_attribute('href', href) 1870 for obj in objs: 1871 DataCenterWriter.write_one(obj, writer, singular) 1872 writer.write_end()
1875class DeviceWriter(Writer): 1876 1877 def __init__(self): 1878 super(DeviceWriter, self).__init__() 1879 1880 @staticmethod 1881 def write_one(obj, writer, singular=None): 1882 if singular is None: 1883 singular = 'device' 1884 writer.write_start(singular) 1885 href = obj.href 1886 if href is not None: 1887 writer.write_attribute('href', href) 1888 if obj.id is not None: 1889 writer.write_attribute('id', obj.id) 1890 if obj.comment is not None: 1891 Writer.write_string(writer, 'comment', obj.comment) 1892 if obj.description is not None: 1893 Writer.write_string(writer, 'description', obj.description) 1894 if obj.name is not None: 1895 Writer.write_string(writer, 'name', obj.name) 1896 if obj.instance_type is not None: 1897 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 1898 if obj.template is not None: 1899 TemplateWriter.write_one(obj.template, writer, 'template') 1900 if obj.vm is not None: 1901 VmWriter.write_one(obj.vm, writer, 'vm') 1902 if obj.vms is not None: 1903 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 1904 writer.write_end() 1905 1906 @staticmethod 1907 def write_many(objs, writer, singular=None, plural=None): 1908 if singular is None: 1909 singular = 'device' 1910 if plural is None: 1911 plural = 'devices' 1912 writer.write_start(plural) 1913 if isinstance(objs, List): 1914 href = objs.href 1915 if href is not None: 1916 writer.write_attribute('href', href) 1917 for obj in objs: 1918 DeviceWriter.write_one(obj, writer, singular) 1919 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1880 @staticmethod 1881 def write_one(obj, writer, singular=None): 1882 if singular is None: 1883 singular = 'device' 1884 writer.write_start(singular) 1885 href = obj.href 1886 if href is not None: 1887 writer.write_attribute('href', href) 1888 if obj.id is not None: 1889 writer.write_attribute('id', obj.id) 1890 if obj.comment is not None: 1891 Writer.write_string(writer, 'comment', obj.comment) 1892 if obj.description is not None: 1893 Writer.write_string(writer, 'description', obj.description) 1894 if obj.name is not None: 1895 Writer.write_string(writer, 'name', obj.name) 1896 if obj.instance_type is not None: 1897 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 1898 if obj.template is not None: 1899 TemplateWriter.write_one(obj.template, writer, 'template') 1900 if obj.vm is not None: 1901 VmWriter.write_one(obj.vm, writer, 'vm') 1902 if obj.vms is not None: 1903 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 1904 writer.write_end()
1906 @staticmethod 1907 def write_many(objs, writer, singular=None, plural=None): 1908 if singular is None: 1909 singular = 'device' 1910 if plural is None: 1911 plural = 'devices' 1912 writer.write_start(plural) 1913 if isinstance(objs, List): 1914 href = objs.href 1915 if href is not None: 1916 writer.write_attribute('href', href) 1917 for obj in objs: 1918 DeviceWriter.write_one(obj, writer, singular) 1919 writer.write_end()
1922class DiskWriter(Writer): 1923 1924 def __init__(self): 1925 super(DiskWriter, self).__init__() 1926 1927 @staticmethod 1928 def write_one(obj, writer, singular=None): 1929 if singular is None: 1930 singular = 'disk' 1931 writer.write_start(singular) 1932 href = obj.href 1933 if href is not None: 1934 writer.write_attribute('href', href) 1935 if obj.id is not None: 1936 writer.write_attribute('id', obj.id) 1937 if obj.active is not None: 1938 Writer.write_boolean(writer, 'active', obj.active) 1939 if obj.actual_size is not None: 1940 Writer.write_integer(writer, 'actual_size', obj.actual_size) 1941 if obj.alias is not None: 1942 Writer.write_string(writer, 'alias', obj.alias) 1943 if obj.backup is not None: 1944 Writer.write_string(writer, 'backup', obj.backup.value) 1945 if obj.backup_mode is not None: 1946 Writer.write_string(writer, 'backup_mode', obj.backup_mode.value) 1947 if obj.bootable is not None: 1948 Writer.write_boolean(writer, 'bootable', obj.bootable) 1949 if obj.comment is not None: 1950 Writer.write_string(writer, 'comment', obj.comment) 1951 if obj.content_type is not None: 1952 Writer.write_string(writer, 'content_type', obj.content_type.value) 1953 if obj.description is not None: 1954 Writer.write_string(writer, 'description', obj.description) 1955 if obj.external_disk is not None: 1956 Writer.write_string(writer, 'external_disk', obj.external_disk) 1957 if obj.format is not None: 1958 Writer.write_string(writer, 'format', obj.format.value) 1959 if obj.image_id is not None: 1960 Writer.write_string(writer, 'image_id', obj.image_id) 1961 if obj.initial_size is not None: 1962 Writer.write_integer(writer, 'initial_size', obj.initial_size) 1963 if obj.interface is not None: 1964 Writer.write_string(writer, 'interface', obj.interface.value) 1965 if obj.logical_name is not None: 1966 Writer.write_string(writer, 'logical_name', obj.logical_name) 1967 if obj.lun_storage is not None: 1968 HostStorageWriter.write_one(obj.lun_storage, writer, 'lun_storage') 1969 if obj.name is not None: 1970 Writer.write_string(writer, 'name', obj.name) 1971 if obj.propagate_errors is not None: 1972 Writer.write_boolean(writer, 'propagate_errors', obj.propagate_errors) 1973 if obj.provisioned_size is not None: 1974 Writer.write_integer(writer, 'provisioned_size', obj.provisioned_size) 1975 if obj.qcow_version is not None: 1976 Writer.write_string(writer, 'qcow_version', obj.qcow_version.value) 1977 if obj.read_only is not None: 1978 Writer.write_boolean(writer, 'read_only', obj.read_only) 1979 if obj.sgio is not None: 1980 Writer.write_string(writer, 'sgio', obj.sgio.value) 1981 if obj.shareable is not None: 1982 Writer.write_boolean(writer, 'shareable', obj.shareable) 1983 if obj.sparse is not None: 1984 Writer.write_boolean(writer, 'sparse', obj.sparse) 1985 if obj.status is not None: 1986 Writer.write_string(writer, 'status', obj.status.value) 1987 if obj.storage_type is not None: 1988 Writer.write_string(writer, 'storage_type', obj.storage_type.value) 1989 if obj.total_size is not None: 1990 Writer.write_integer(writer, 'total_size', obj.total_size) 1991 if obj.uses_scsi_reservation is not None: 1992 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 1993 if obj.wipe_after_delete is not None: 1994 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 1995 if obj.disk_profile is not None: 1996 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 1997 if obj.disk_snapshots is not None: 1998 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 1999 if obj.instance_type is not None: 2000 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 2001 if obj.openstack_volume_type is not None: 2002 OpenStackVolumeTypeWriter.write_one(obj.openstack_volume_type, writer, 'openstack_volume_type') 2003 if obj.permissions is not None: 2004 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2005 if obj.quota is not None: 2006 QuotaWriter.write_one(obj.quota, writer, 'quota') 2007 if obj.snapshot is not None: 2008 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 2009 if obj.statistics is not None: 2010 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 2011 if obj.storage_domain is not None: 2012 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2013 if obj.storage_domains is not None: 2014 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 2015 if obj.template is not None: 2016 TemplateWriter.write_one(obj.template, writer, 'template') 2017 if obj.vm is not None: 2018 VmWriter.write_one(obj.vm, writer, 'vm') 2019 if obj.vms is not None: 2020 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 2021 writer.write_end() 2022 2023 @staticmethod 2024 def write_many(objs, writer, singular=None, plural=None): 2025 if singular is None: 2026 singular = 'disk' 2027 if plural is None: 2028 plural = 'disks' 2029 writer.write_start(plural) 2030 if isinstance(objs, List): 2031 href = objs.href 2032 if href is not None: 2033 writer.write_attribute('href', href) 2034 for obj in objs: 2035 DiskWriter.write_one(obj, writer, singular) 2036 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
1927 @staticmethod 1928 def write_one(obj, writer, singular=None): 1929 if singular is None: 1930 singular = 'disk' 1931 writer.write_start(singular) 1932 href = obj.href 1933 if href is not None: 1934 writer.write_attribute('href', href) 1935 if obj.id is not None: 1936 writer.write_attribute('id', obj.id) 1937 if obj.active is not None: 1938 Writer.write_boolean(writer, 'active', obj.active) 1939 if obj.actual_size is not None: 1940 Writer.write_integer(writer, 'actual_size', obj.actual_size) 1941 if obj.alias is not None: 1942 Writer.write_string(writer, 'alias', obj.alias) 1943 if obj.backup is not None: 1944 Writer.write_string(writer, 'backup', obj.backup.value) 1945 if obj.backup_mode is not None: 1946 Writer.write_string(writer, 'backup_mode', obj.backup_mode.value) 1947 if obj.bootable is not None: 1948 Writer.write_boolean(writer, 'bootable', obj.bootable) 1949 if obj.comment is not None: 1950 Writer.write_string(writer, 'comment', obj.comment) 1951 if obj.content_type is not None: 1952 Writer.write_string(writer, 'content_type', obj.content_type.value) 1953 if obj.description is not None: 1954 Writer.write_string(writer, 'description', obj.description) 1955 if obj.external_disk is not None: 1956 Writer.write_string(writer, 'external_disk', obj.external_disk) 1957 if obj.format is not None: 1958 Writer.write_string(writer, 'format', obj.format.value) 1959 if obj.image_id is not None: 1960 Writer.write_string(writer, 'image_id', obj.image_id) 1961 if obj.initial_size is not None: 1962 Writer.write_integer(writer, 'initial_size', obj.initial_size) 1963 if obj.interface is not None: 1964 Writer.write_string(writer, 'interface', obj.interface.value) 1965 if obj.logical_name is not None: 1966 Writer.write_string(writer, 'logical_name', obj.logical_name) 1967 if obj.lun_storage is not None: 1968 HostStorageWriter.write_one(obj.lun_storage, writer, 'lun_storage') 1969 if obj.name is not None: 1970 Writer.write_string(writer, 'name', obj.name) 1971 if obj.propagate_errors is not None: 1972 Writer.write_boolean(writer, 'propagate_errors', obj.propagate_errors) 1973 if obj.provisioned_size is not None: 1974 Writer.write_integer(writer, 'provisioned_size', obj.provisioned_size) 1975 if obj.qcow_version is not None: 1976 Writer.write_string(writer, 'qcow_version', obj.qcow_version.value) 1977 if obj.read_only is not None: 1978 Writer.write_boolean(writer, 'read_only', obj.read_only) 1979 if obj.sgio is not None: 1980 Writer.write_string(writer, 'sgio', obj.sgio.value) 1981 if obj.shareable is not None: 1982 Writer.write_boolean(writer, 'shareable', obj.shareable) 1983 if obj.sparse is not None: 1984 Writer.write_boolean(writer, 'sparse', obj.sparse) 1985 if obj.status is not None: 1986 Writer.write_string(writer, 'status', obj.status.value) 1987 if obj.storage_type is not None: 1988 Writer.write_string(writer, 'storage_type', obj.storage_type.value) 1989 if obj.total_size is not None: 1990 Writer.write_integer(writer, 'total_size', obj.total_size) 1991 if obj.uses_scsi_reservation is not None: 1992 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 1993 if obj.wipe_after_delete is not None: 1994 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 1995 if obj.disk_profile is not None: 1996 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 1997 if obj.disk_snapshots is not None: 1998 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 1999 if obj.instance_type is not None: 2000 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 2001 if obj.openstack_volume_type is not None: 2002 OpenStackVolumeTypeWriter.write_one(obj.openstack_volume_type, writer, 'openstack_volume_type') 2003 if obj.permissions is not None: 2004 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2005 if obj.quota is not None: 2006 QuotaWriter.write_one(obj.quota, writer, 'quota') 2007 if obj.snapshot is not None: 2008 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 2009 if obj.statistics is not None: 2010 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 2011 if obj.storage_domain is not None: 2012 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2013 if obj.storage_domains is not None: 2014 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 2015 if obj.template is not None: 2016 TemplateWriter.write_one(obj.template, writer, 'template') 2017 if obj.vm is not None: 2018 VmWriter.write_one(obj.vm, writer, 'vm') 2019 if obj.vms is not None: 2020 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 2021 writer.write_end()
2023 @staticmethod 2024 def write_many(objs, writer, singular=None, plural=None): 2025 if singular is None: 2026 singular = 'disk' 2027 if plural is None: 2028 plural = 'disks' 2029 writer.write_start(plural) 2030 if isinstance(objs, List): 2031 href = objs.href 2032 if href is not None: 2033 writer.write_attribute('href', href) 2034 for obj in objs: 2035 DiskWriter.write_one(obj, writer, singular) 2036 writer.write_end()
2039class DiskAttachmentWriter(Writer): 2040 2041 def __init__(self): 2042 super(DiskAttachmentWriter, self).__init__() 2043 2044 @staticmethod 2045 def write_one(obj, writer, singular=None): 2046 if singular is None: 2047 singular = 'disk_attachment' 2048 writer.write_start(singular) 2049 href = obj.href 2050 if href is not None: 2051 writer.write_attribute('href', href) 2052 if obj.id is not None: 2053 writer.write_attribute('id', obj.id) 2054 if obj.active is not None: 2055 Writer.write_boolean(writer, 'active', obj.active) 2056 if obj.bootable is not None: 2057 Writer.write_boolean(writer, 'bootable', obj.bootable) 2058 if obj.comment is not None: 2059 Writer.write_string(writer, 'comment', obj.comment) 2060 if obj.description is not None: 2061 Writer.write_string(writer, 'description', obj.description) 2062 if obj.interface is not None: 2063 Writer.write_string(writer, 'interface', obj.interface.value) 2064 if obj.logical_name is not None: 2065 Writer.write_string(writer, 'logical_name', obj.logical_name) 2066 if obj.name is not None: 2067 Writer.write_string(writer, 'name', obj.name) 2068 if obj.pass_discard is not None: 2069 Writer.write_boolean(writer, 'pass_discard', obj.pass_discard) 2070 if obj.read_only is not None: 2071 Writer.write_boolean(writer, 'read_only', obj.read_only) 2072 if obj.uses_scsi_reservation is not None: 2073 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 2074 if obj.disk is not None: 2075 DiskWriter.write_one(obj.disk, writer, 'disk') 2076 if obj.template is not None: 2077 TemplateWriter.write_one(obj.template, writer, 'template') 2078 if obj.vm is not None: 2079 VmWriter.write_one(obj.vm, writer, 'vm') 2080 writer.write_end() 2081 2082 @staticmethod 2083 def write_many(objs, writer, singular=None, plural=None): 2084 if singular is None: 2085 singular = 'disk_attachment' 2086 if plural is None: 2087 plural = 'disk_attachments' 2088 writer.write_start(plural) 2089 if isinstance(objs, List): 2090 href = objs.href 2091 if href is not None: 2092 writer.write_attribute('href', href) 2093 for obj in objs: 2094 DiskAttachmentWriter.write_one(obj, writer, singular) 2095 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2044 @staticmethod 2045 def write_one(obj, writer, singular=None): 2046 if singular is None: 2047 singular = 'disk_attachment' 2048 writer.write_start(singular) 2049 href = obj.href 2050 if href is not None: 2051 writer.write_attribute('href', href) 2052 if obj.id is not None: 2053 writer.write_attribute('id', obj.id) 2054 if obj.active is not None: 2055 Writer.write_boolean(writer, 'active', obj.active) 2056 if obj.bootable is not None: 2057 Writer.write_boolean(writer, 'bootable', obj.bootable) 2058 if obj.comment is not None: 2059 Writer.write_string(writer, 'comment', obj.comment) 2060 if obj.description is not None: 2061 Writer.write_string(writer, 'description', obj.description) 2062 if obj.interface is not None: 2063 Writer.write_string(writer, 'interface', obj.interface.value) 2064 if obj.logical_name is not None: 2065 Writer.write_string(writer, 'logical_name', obj.logical_name) 2066 if obj.name is not None: 2067 Writer.write_string(writer, 'name', obj.name) 2068 if obj.pass_discard is not None: 2069 Writer.write_boolean(writer, 'pass_discard', obj.pass_discard) 2070 if obj.read_only is not None: 2071 Writer.write_boolean(writer, 'read_only', obj.read_only) 2072 if obj.uses_scsi_reservation is not None: 2073 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 2074 if obj.disk is not None: 2075 DiskWriter.write_one(obj.disk, writer, 'disk') 2076 if obj.template is not None: 2077 TemplateWriter.write_one(obj.template, writer, 'template') 2078 if obj.vm is not None: 2079 VmWriter.write_one(obj.vm, writer, 'vm') 2080 writer.write_end()
2082 @staticmethod 2083 def write_many(objs, writer, singular=None, plural=None): 2084 if singular is None: 2085 singular = 'disk_attachment' 2086 if plural is None: 2087 plural = 'disk_attachments' 2088 writer.write_start(plural) 2089 if isinstance(objs, List): 2090 href = objs.href 2091 if href is not None: 2092 writer.write_attribute('href', href) 2093 for obj in objs: 2094 DiskAttachmentWriter.write_one(obj, writer, singular) 2095 writer.write_end()
2098class DiskProfileWriter(Writer): 2099 2100 def __init__(self): 2101 super(DiskProfileWriter, self).__init__() 2102 2103 @staticmethod 2104 def write_one(obj, writer, singular=None): 2105 if singular is None: 2106 singular = 'disk_profile' 2107 writer.write_start(singular) 2108 href = obj.href 2109 if href is not None: 2110 writer.write_attribute('href', href) 2111 if obj.id is not None: 2112 writer.write_attribute('id', obj.id) 2113 if obj.comment is not None: 2114 Writer.write_string(writer, 'comment', obj.comment) 2115 if obj.description is not None: 2116 Writer.write_string(writer, 'description', obj.description) 2117 if obj.name is not None: 2118 Writer.write_string(writer, 'name', obj.name) 2119 if obj.permissions is not None: 2120 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2121 if obj.qos is not None: 2122 QosWriter.write_one(obj.qos, writer, 'qos') 2123 if obj.storage_domain is not None: 2124 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2125 writer.write_end() 2126 2127 @staticmethod 2128 def write_many(objs, writer, singular=None, plural=None): 2129 if singular is None: 2130 singular = 'disk_profile' 2131 if plural is None: 2132 plural = 'disk_profiles' 2133 writer.write_start(plural) 2134 if isinstance(objs, List): 2135 href = objs.href 2136 if href is not None: 2137 writer.write_attribute('href', href) 2138 for obj in objs: 2139 DiskProfileWriter.write_one(obj, writer, singular) 2140 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2103 @staticmethod 2104 def write_one(obj, writer, singular=None): 2105 if singular is None: 2106 singular = 'disk_profile' 2107 writer.write_start(singular) 2108 href = obj.href 2109 if href is not None: 2110 writer.write_attribute('href', href) 2111 if obj.id is not None: 2112 writer.write_attribute('id', obj.id) 2113 if obj.comment is not None: 2114 Writer.write_string(writer, 'comment', obj.comment) 2115 if obj.description is not None: 2116 Writer.write_string(writer, 'description', obj.description) 2117 if obj.name is not None: 2118 Writer.write_string(writer, 'name', obj.name) 2119 if obj.permissions is not None: 2120 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2121 if obj.qos is not None: 2122 QosWriter.write_one(obj.qos, writer, 'qos') 2123 if obj.storage_domain is not None: 2124 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2125 writer.write_end()
2127 @staticmethod 2128 def write_many(objs, writer, singular=None, plural=None): 2129 if singular is None: 2130 singular = 'disk_profile' 2131 if plural is None: 2132 plural = 'disk_profiles' 2133 writer.write_start(plural) 2134 if isinstance(objs, List): 2135 href = objs.href 2136 if href is not None: 2137 writer.write_attribute('href', href) 2138 for obj in objs: 2139 DiskProfileWriter.write_one(obj, writer, singular) 2140 writer.write_end()
2143class DiskSnapshotWriter(Writer): 2144 2145 def __init__(self): 2146 super(DiskSnapshotWriter, self).__init__() 2147 2148 @staticmethod 2149 def write_one(obj, writer, singular=None): 2150 if singular is None: 2151 singular = 'disk_snapshot' 2152 writer.write_start(singular) 2153 href = obj.href 2154 if href is not None: 2155 writer.write_attribute('href', href) 2156 if obj.id is not None: 2157 writer.write_attribute('id', obj.id) 2158 if obj.active is not None: 2159 Writer.write_boolean(writer, 'active', obj.active) 2160 if obj.actual_size is not None: 2161 Writer.write_integer(writer, 'actual_size', obj.actual_size) 2162 if obj.alias is not None: 2163 Writer.write_string(writer, 'alias', obj.alias) 2164 if obj.backup is not None: 2165 Writer.write_string(writer, 'backup', obj.backup.value) 2166 if obj.backup_mode is not None: 2167 Writer.write_string(writer, 'backup_mode', obj.backup_mode.value) 2168 if obj.bootable is not None: 2169 Writer.write_boolean(writer, 'bootable', obj.bootable) 2170 if obj.comment is not None: 2171 Writer.write_string(writer, 'comment', obj.comment) 2172 if obj.content_type is not None: 2173 Writer.write_string(writer, 'content_type', obj.content_type.value) 2174 if obj.description is not None: 2175 Writer.write_string(writer, 'description', obj.description) 2176 if obj.external_disk is not None: 2177 Writer.write_string(writer, 'external_disk', obj.external_disk) 2178 if obj.format is not None: 2179 Writer.write_string(writer, 'format', obj.format.value) 2180 if obj.image_id is not None: 2181 Writer.write_string(writer, 'image_id', obj.image_id) 2182 if obj.initial_size is not None: 2183 Writer.write_integer(writer, 'initial_size', obj.initial_size) 2184 if obj.interface is not None: 2185 Writer.write_string(writer, 'interface', obj.interface.value) 2186 if obj.logical_name is not None: 2187 Writer.write_string(writer, 'logical_name', obj.logical_name) 2188 if obj.lun_storage is not None: 2189 HostStorageWriter.write_one(obj.lun_storage, writer, 'lun_storage') 2190 if obj.name is not None: 2191 Writer.write_string(writer, 'name', obj.name) 2192 if obj.propagate_errors is not None: 2193 Writer.write_boolean(writer, 'propagate_errors', obj.propagate_errors) 2194 if obj.provisioned_size is not None: 2195 Writer.write_integer(writer, 'provisioned_size', obj.provisioned_size) 2196 if obj.qcow_version is not None: 2197 Writer.write_string(writer, 'qcow_version', obj.qcow_version.value) 2198 if obj.read_only is not None: 2199 Writer.write_boolean(writer, 'read_only', obj.read_only) 2200 if obj.sgio is not None: 2201 Writer.write_string(writer, 'sgio', obj.sgio.value) 2202 if obj.shareable is not None: 2203 Writer.write_boolean(writer, 'shareable', obj.shareable) 2204 if obj.sparse is not None: 2205 Writer.write_boolean(writer, 'sparse', obj.sparse) 2206 if obj.status is not None: 2207 Writer.write_string(writer, 'status', obj.status.value) 2208 if obj.storage_type is not None: 2209 Writer.write_string(writer, 'storage_type', obj.storage_type.value) 2210 if obj.total_size is not None: 2211 Writer.write_integer(writer, 'total_size', obj.total_size) 2212 if obj.uses_scsi_reservation is not None: 2213 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 2214 if obj.wipe_after_delete is not None: 2215 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 2216 if obj.disk is not None: 2217 DiskWriter.write_one(obj.disk, writer, 'disk') 2218 if obj.disk_profile is not None: 2219 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 2220 if obj.disk_snapshots is not None: 2221 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 2222 if obj.instance_type is not None: 2223 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 2224 if obj.openstack_volume_type is not None: 2225 OpenStackVolumeTypeWriter.write_one(obj.openstack_volume_type, writer, 'openstack_volume_type') 2226 if obj.parent is not None: 2227 DiskSnapshotWriter.write_one(obj.parent, writer, 'parent') 2228 if obj.permissions is not None: 2229 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2230 if obj.quota is not None: 2231 QuotaWriter.write_one(obj.quota, writer, 'quota') 2232 if obj.snapshot is not None: 2233 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 2234 if obj.statistics is not None: 2235 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 2236 if obj.storage_domain is not None: 2237 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2238 if obj.storage_domains is not None: 2239 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 2240 if obj.template is not None: 2241 TemplateWriter.write_one(obj.template, writer, 'template') 2242 if obj.vm is not None: 2243 VmWriter.write_one(obj.vm, writer, 'vm') 2244 if obj.vms is not None: 2245 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 2246 writer.write_end() 2247 2248 @staticmethod 2249 def write_many(objs, writer, singular=None, plural=None): 2250 if singular is None: 2251 singular = 'disk_snapshot' 2252 if plural is None: 2253 plural = 'disk_snapshots' 2254 writer.write_start(plural) 2255 if isinstance(objs, List): 2256 href = objs.href 2257 if href is not None: 2258 writer.write_attribute('href', href) 2259 for obj in objs: 2260 DiskSnapshotWriter.write_one(obj, writer, singular) 2261 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2148 @staticmethod 2149 def write_one(obj, writer, singular=None): 2150 if singular is None: 2151 singular = 'disk_snapshot' 2152 writer.write_start(singular) 2153 href = obj.href 2154 if href is not None: 2155 writer.write_attribute('href', href) 2156 if obj.id is not None: 2157 writer.write_attribute('id', obj.id) 2158 if obj.active is not None: 2159 Writer.write_boolean(writer, 'active', obj.active) 2160 if obj.actual_size is not None: 2161 Writer.write_integer(writer, 'actual_size', obj.actual_size) 2162 if obj.alias is not None: 2163 Writer.write_string(writer, 'alias', obj.alias) 2164 if obj.backup is not None: 2165 Writer.write_string(writer, 'backup', obj.backup.value) 2166 if obj.backup_mode is not None: 2167 Writer.write_string(writer, 'backup_mode', obj.backup_mode.value) 2168 if obj.bootable is not None: 2169 Writer.write_boolean(writer, 'bootable', obj.bootable) 2170 if obj.comment is not None: 2171 Writer.write_string(writer, 'comment', obj.comment) 2172 if obj.content_type is not None: 2173 Writer.write_string(writer, 'content_type', obj.content_type.value) 2174 if obj.description is not None: 2175 Writer.write_string(writer, 'description', obj.description) 2176 if obj.external_disk is not None: 2177 Writer.write_string(writer, 'external_disk', obj.external_disk) 2178 if obj.format is not None: 2179 Writer.write_string(writer, 'format', obj.format.value) 2180 if obj.image_id is not None: 2181 Writer.write_string(writer, 'image_id', obj.image_id) 2182 if obj.initial_size is not None: 2183 Writer.write_integer(writer, 'initial_size', obj.initial_size) 2184 if obj.interface is not None: 2185 Writer.write_string(writer, 'interface', obj.interface.value) 2186 if obj.logical_name is not None: 2187 Writer.write_string(writer, 'logical_name', obj.logical_name) 2188 if obj.lun_storage is not None: 2189 HostStorageWriter.write_one(obj.lun_storage, writer, 'lun_storage') 2190 if obj.name is not None: 2191 Writer.write_string(writer, 'name', obj.name) 2192 if obj.propagate_errors is not None: 2193 Writer.write_boolean(writer, 'propagate_errors', obj.propagate_errors) 2194 if obj.provisioned_size is not None: 2195 Writer.write_integer(writer, 'provisioned_size', obj.provisioned_size) 2196 if obj.qcow_version is not None: 2197 Writer.write_string(writer, 'qcow_version', obj.qcow_version.value) 2198 if obj.read_only is not None: 2199 Writer.write_boolean(writer, 'read_only', obj.read_only) 2200 if obj.sgio is not None: 2201 Writer.write_string(writer, 'sgio', obj.sgio.value) 2202 if obj.shareable is not None: 2203 Writer.write_boolean(writer, 'shareable', obj.shareable) 2204 if obj.sparse is not None: 2205 Writer.write_boolean(writer, 'sparse', obj.sparse) 2206 if obj.status is not None: 2207 Writer.write_string(writer, 'status', obj.status.value) 2208 if obj.storage_type is not None: 2209 Writer.write_string(writer, 'storage_type', obj.storage_type.value) 2210 if obj.total_size is not None: 2211 Writer.write_integer(writer, 'total_size', obj.total_size) 2212 if obj.uses_scsi_reservation is not None: 2213 Writer.write_boolean(writer, 'uses_scsi_reservation', obj.uses_scsi_reservation) 2214 if obj.wipe_after_delete is not None: 2215 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 2216 if obj.disk is not None: 2217 DiskWriter.write_one(obj.disk, writer, 'disk') 2218 if obj.disk_profile is not None: 2219 DiskProfileWriter.write_one(obj.disk_profile, writer, 'disk_profile') 2220 if obj.disk_snapshots is not None: 2221 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 2222 if obj.instance_type is not None: 2223 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 2224 if obj.openstack_volume_type is not None: 2225 OpenStackVolumeTypeWriter.write_one(obj.openstack_volume_type, writer, 'openstack_volume_type') 2226 if obj.parent is not None: 2227 DiskSnapshotWriter.write_one(obj.parent, writer, 'parent') 2228 if obj.permissions is not None: 2229 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 2230 if obj.quota is not None: 2231 QuotaWriter.write_one(obj.quota, writer, 'quota') 2232 if obj.snapshot is not None: 2233 SnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 2234 if obj.statistics is not None: 2235 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 2236 if obj.storage_domain is not None: 2237 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2238 if obj.storage_domains is not None: 2239 StorageDomainWriter.write_many(obj.storage_domains, writer, 'storage_domain', 'storage_domains') 2240 if obj.template is not None: 2241 TemplateWriter.write_one(obj.template, writer, 'template') 2242 if obj.vm is not None: 2243 VmWriter.write_one(obj.vm, writer, 'vm') 2244 if obj.vms is not None: 2245 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 2246 writer.write_end()
2248 @staticmethod 2249 def write_many(objs, writer, singular=None, plural=None): 2250 if singular is None: 2251 singular = 'disk_snapshot' 2252 if plural is None: 2253 plural = 'disk_snapshots' 2254 writer.write_start(plural) 2255 if isinstance(objs, List): 2256 href = objs.href 2257 if href is not None: 2258 writer.write_attribute('href', href) 2259 for obj in objs: 2260 DiskSnapshotWriter.write_one(obj, writer, singular) 2261 writer.write_end()
2264class DisplayWriter(Writer): 2265 2266 def __init__(self): 2267 super(DisplayWriter, self).__init__() 2268 2269 @staticmethod 2270 def write_one(obj, writer, singular=None): 2271 if singular is None: 2272 singular = 'display' 2273 writer.write_start(singular) 2274 href = obj.href 2275 if href is not None: 2276 writer.write_attribute('href', href) 2277 if obj.address is not None: 2278 Writer.write_string(writer, 'address', obj.address) 2279 if obj.allow_override is not None: 2280 Writer.write_boolean(writer, 'allow_override', obj.allow_override) 2281 if obj.certificate is not None: 2282 CertificateWriter.write_one(obj.certificate, writer, 'certificate') 2283 if obj.copy_paste_enabled is not None: 2284 Writer.write_boolean(writer, 'copy_paste_enabled', obj.copy_paste_enabled) 2285 if obj.disconnect_action is not None: 2286 Writer.write_string(writer, 'disconnect_action', obj.disconnect_action) 2287 if obj.disconnect_action_delay is not None: 2288 Writer.write_integer(writer, 'disconnect_action_delay', obj.disconnect_action_delay) 2289 if obj.file_transfer_enabled is not None: 2290 Writer.write_boolean(writer, 'file_transfer_enabled', obj.file_transfer_enabled) 2291 if obj.keyboard_layout is not None: 2292 Writer.write_string(writer, 'keyboard_layout', obj.keyboard_layout) 2293 if obj.monitors is not None: 2294 Writer.write_integer(writer, 'monitors', obj.monitors) 2295 if obj.port is not None: 2296 Writer.write_integer(writer, 'port', obj.port) 2297 if obj.proxy is not None: 2298 Writer.write_string(writer, 'proxy', obj.proxy) 2299 if obj.secure_port is not None: 2300 Writer.write_integer(writer, 'secure_port', obj.secure_port) 2301 if obj.single_qxl_pci is not None: 2302 Writer.write_boolean(writer, 'single_qxl_pci', obj.single_qxl_pci) 2303 if obj.smartcard_enabled is not None: 2304 Writer.write_boolean(writer, 'smartcard_enabled', obj.smartcard_enabled) 2305 if obj.type is not None: 2306 Writer.write_string(writer, 'type', obj.type.value) 2307 if obj.video_type is not None: 2308 Writer.write_string(writer, 'video_type', obj.video_type.value) 2309 writer.write_end() 2310 2311 @staticmethod 2312 def write_many(objs, writer, singular=None, plural=None): 2313 if singular is None: 2314 singular = 'display' 2315 if plural is None: 2316 plural = 'displays' 2317 writer.write_start(plural) 2318 if isinstance(objs, List): 2319 href = objs.href 2320 if href is not None: 2321 writer.write_attribute('href', href) 2322 for obj in objs: 2323 DisplayWriter.write_one(obj, writer, singular) 2324 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2269 @staticmethod 2270 def write_one(obj, writer, singular=None): 2271 if singular is None: 2272 singular = 'display' 2273 writer.write_start(singular) 2274 href = obj.href 2275 if href is not None: 2276 writer.write_attribute('href', href) 2277 if obj.address is not None: 2278 Writer.write_string(writer, 'address', obj.address) 2279 if obj.allow_override is not None: 2280 Writer.write_boolean(writer, 'allow_override', obj.allow_override) 2281 if obj.certificate is not None: 2282 CertificateWriter.write_one(obj.certificate, writer, 'certificate') 2283 if obj.copy_paste_enabled is not None: 2284 Writer.write_boolean(writer, 'copy_paste_enabled', obj.copy_paste_enabled) 2285 if obj.disconnect_action is not None: 2286 Writer.write_string(writer, 'disconnect_action', obj.disconnect_action) 2287 if obj.disconnect_action_delay is not None: 2288 Writer.write_integer(writer, 'disconnect_action_delay', obj.disconnect_action_delay) 2289 if obj.file_transfer_enabled is not None: 2290 Writer.write_boolean(writer, 'file_transfer_enabled', obj.file_transfer_enabled) 2291 if obj.keyboard_layout is not None: 2292 Writer.write_string(writer, 'keyboard_layout', obj.keyboard_layout) 2293 if obj.monitors is not None: 2294 Writer.write_integer(writer, 'monitors', obj.monitors) 2295 if obj.port is not None: 2296 Writer.write_integer(writer, 'port', obj.port) 2297 if obj.proxy is not None: 2298 Writer.write_string(writer, 'proxy', obj.proxy) 2299 if obj.secure_port is not None: 2300 Writer.write_integer(writer, 'secure_port', obj.secure_port) 2301 if obj.single_qxl_pci is not None: 2302 Writer.write_boolean(writer, 'single_qxl_pci', obj.single_qxl_pci) 2303 if obj.smartcard_enabled is not None: 2304 Writer.write_boolean(writer, 'smartcard_enabled', obj.smartcard_enabled) 2305 if obj.type is not None: 2306 Writer.write_string(writer, 'type', obj.type.value) 2307 if obj.video_type is not None: 2308 Writer.write_string(writer, 'video_type', obj.video_type.value) 2309 writer.write_end()
2311 @staticmethod 2312 def write_many(objs, writer, singular=None, plural=None): 2313 if singular is None: 2314 singular = 'display' 2315 if plural is None: 2316 plural = 'displays' 2317 writer.write_start(plural) 2318 if isinstance(objs, List): 2319 href = objs.href 2320 if href is not None: 2321 writer.write_attribute('href', href) 2322 for obj in objs: 2323 DisplayWriter.write_one(obj, writer, singular) 2324 writer.write_end()
2327class DnsWriter(Writer): 2328 2329 def __init__(self): 2330 super(DnsWriter, self).__init__() 2331 2332 @staticmethod 2333 def write_one(obj, writer, singular=None): 2334 if singular is None: 2335 singular = 'dns' 2336 writer.write_start(singular) 2337 href = obj.href 2338 if href is not None: 2339 writer.write_attribute('href', href) 2340 if obj.search_domains is not None: 2341 HostWriter.write_many(obj.search_domains, writer, 'host', 'search_domains') 2342 if obj.servers is not None: 2343 HostWriter.write_many(obj.servers, writer, 'host', 'servers') 2344 writer.write_end() 2345 2346 @staticmethod 2347 def write_many(objs, writer, singular=None, plural=None): 2348 if singular is None: 2349 singular = 'dns' 2350 if plural is None: 2351 plural = 'dnss' 2352 writer.write_start(plural) 2353 if isinstance(objs, List): 2354 href = objs.href 2355 if href is not None: 2356 writer.write_attribute('href', href) 2357 for obj in objs: 2358 DnsWriter.write_one(obj, writer, singular) 2359 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2332 @staticmethod 2333 def write_one(obj, writer, singular=None): 2334 if singular is None: 2335 singular = 'dns' 2336 writer.write_start(singular) 2337 href = obj.href 2338 if href is not None: 2339 writer.write_attribute('href', href) 2340 if obj.search_domains is not None: 2341 HostWriter.write_many(obj.search_domains, writer, 'host', 'search_domains') 2342 if obj.servers is not None: 2343 HostWriter.write_many(obj.servers, writer, 'host', 'servers') 2344 writer.write_end()
2346 @staticmethod 2347 def write_many(objs, writer, singular=None, plural=None): 2348 if singular is None: 2349 singular = 'dns' 2350 if plural is None: 2351 plural = 'dnss' 2352 writer.write_start(plural) 2353 if isinstance(objs, List): 2354 href = objs.href 2355 if href is not None: 2356 writer.write_attribute('href', href) 2357 for obj in objs: 2358 DnsWriter.write_one(obj, writer, singular) 2359 writer.write_end()
2362class DnsResolverConfigurationWriter(Writer): 2363 2364 def __init__(self): 2365 super(DnsResolverConfigurationWriter, self).__init__() 2366 2367 @staticmethod 2368 def write_one(obj, writer, singular=None): 2369 if singular is None: 2370 singular = 'dns_resolver_configuration' 2371 writer.write_start(singular) 2372 href = obj.href 2373 if href is not None: 2374 writer.write_attribute('href', href) 2375 if obj.name_servers is not None: 2376 writer.write_start('name_servers') 2377 for item in obj.name_servers: 2378 if item is not None: 2379 Writer.write_string(writer, 'name_server', item) 2380 writer.write_end() 2381 writer.write_end() 2382 2383 @staticmethod 2384 def write_many(objs, writer, singular=None, plural=None): 2385 if singular is None: 2386 singular = 'dns_resolver_configuration' 2387 if plural is None: 2388 plural = 'dns_resolver_configurations' 2389 writer.write_start(plural) 2390 if isinstance(objs, List): 2391 href = objs.href 2392 if href is not None: 2393 writer.write_attribute('href', href) 2394 for obj in objs: 2395 DnsResolverConfigurationWriter.write_one(obj, writer, singular) 2396 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2367 @staticmethod 2368 def write_one(obj, writer, singular=None): 2369 if singular is None: 2370 singular = 'dns_resolver_configuration' 2371 writer.write_start(singular) 2372 href = obj.href 2373 if href is not None: 2374 writer.write_attribute('href', href) 2375 if obj.name_servers is not None: 2376 writer.write_start('name_servers') 2377 for item in obj.name_servers: 2378 if item is not None: 2379 Writer.write_string(writer, 'name_server', item) 2380 writer.write_end() 2381 writer.write_end()
2383 @staticmethod 2384 def write_many(objs, writer, singular=None, plural=None): 2385 if singular is None: 2386 singular = 'dns_resolver_configuration' 2387 if plural is None: 2388 plural = 'dns_resolver_configurations' 2389 writer.write_start(plural) 2390 if isinstance(objs, List): 2391 href = objs.href 2392 if href is not None: 2393 writer.write_attribute('href', href) 2394 for obj in objs: 2395 DnsResolverConfigurationWriter.write_one(obj, writer, singular) 2396 writer.write_end()
2399class DomainWriter(Writer): 2400 2401 def __init__(self): 2402 super(DomainWriter, self).__init__() 2403 2404 @staticmethod 2405 def write_one(obj, writer, singular=None): 2406 if singular is None: 2407 singular = 'domain' 2408 writer.write_start(singular) 2409 href = obj.href 2410 if href is not None: 2411 writer.write_attribute('href', href) 2412 if obj.id is not None: 2413 writer.write_attribute('id', obj.id) 2414 if obj.comment is not None: 2415 Writer.write_string(writer, 'comment', obj.comment) 2416 if obj.description is not None: 2417 Writer.write_string(writer, 'description', obj.description) 2418 if obj.name is not None: 2419 Writer.write_string(writer, 'name', obj.name) 2420 if obj.user is not None: 2421 UserWriter.write_one(obj.user, writer, 'user') 2422 if obj.groups is not None: 2423 GroupWriter.write_many(obj.groups, writer, 'group', 'groups') 2424 if obj.users is not None: 2425 UserWriter.write_many(obj.users, writer, 'user', 'users') 2426 writer.write_end() 2427 2428 @staticmethod 2429 def write_many(objs, writer, singular=None, plural=None): 2430 if singular is None: 2431 singular = 'domain' 2432 if plural is None: 2433 plural = 'domains' 2434 writer.write_start(plural) 2435 if isinstance(objs, List): 2436 href = objs.href 2437 if href is not None: 2438 writer.write_attribute('href', href) 2439 for obj in objs: 2440 DomainWriter.write_one(obj, writer, singular) 2441 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2404 @staticmethod 2405 def write_one(obj, writer, singular=None): 2406 if singular is None: 2407 singular = 'domain' 2408 writer.write_start(singular) 2409 href = obj.href 2410 if href is not None: 2411 writer.write_attribute('href', href) 2412 if obj.id is not None: 2413 writer.write_attribute('id', obj.id) 2414 if obj.comment is not None: 2415 Writer.write_string(writer, 'comment', obj.comment) 2416 if obj.description is not None: 2417 Writer.write_string(writer, 'description', obj.description) 2418 if obj.name is not None: 2419 Writer.write_string(writer, 'name', obj.name) 2420 if obj.user is not None: 2421 UserWriter.write_one(obj.user, writer, 'user') 2422 if obj.groups is not None: 2423 GroupWriter.write_many(obj.groups, writer, 'group', 'groups') 2424 if obj.users is not None: 2425 UserWriter.write_many(obj.users, writer, 'user', 'users') 2426 writer.write_end()
2428 @staticmethod 2429 def write_many(objs, writer, singular=None, plural=None): 2430 if singular is None: 2431 singular = 'domain' 2432 if plural is None: 2433 plural = 'domains' 2434 writer.write_start(plural) 2435 if isinstance(objs, List): 2436 href = objs.href 2437 if href is not None: 2438 writer.write_attribute('href', href) 2439 for obj in objs: 2440 DomainWriter.write_one(obj, writer, singular) 2441 writer.write_end()
2444class DynamicCpuWriter(Writer): 2445 2446 def __init__(self): 2447 super(DynamicCpuWriter, self).__init__() 2448 2449 @staticmethod 2450 def write_one(obj, writer, singular=None): 2451 if singular is None: 2452 singular = 'dynamic_cpu' 2453 writer.write_start(singular) 2454 href = obj.href 2455 if href is not None: 2456 writer.write_attribute('href', href) 2457 if obj.cpu_tune is not None: 2458 CpuTuneWriter.write_one(obj.cpu_tune, writer, 'cpu_tune') 2459 if obj.topology is not None: 2460 CpuTopologyWriter.write_one(obj.topology, writer, 'topology') 2461 writer.write_end() 2462 2463 @staticmethod 2464 def write_many(objs, writer, singular=None, plural=None): 2465 if singular is None: 2466 singular = 'dynamic_cpu' 2467 if plural is None: 2468 plural = 'dynamic_cpus' 2469 writer.write_start(plural) 2470 if isinstance(objs, List): 2471 href = objs.href 2472 if href is not None: 2473 writer.write_attribute('href', href) 2474 for obj in objs: 2475 DynamicCpuWriter.write_one(obj, writer, singular) 2476 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2449 @staticmethod 2450 def write_one(obj, writer, singular=None): 2451 if singular is None: 2452 singular = 'dynamic_cpu' 2453 writer.write_start(singular) 2454 href = obj.href 2455 if href is not None: 2456 writer.write_attribute('href', href) 2457 if obj.cpu_tune is not None: 2458 CpuTuneWriter.write_one(obj.cpu_tune, writer, 'cpu_tune') 2459 if obj.topology is not None: 2460 CpuTopologyWriter.write_one(obj.topology, writer, 'topology') 2461 writer.write_end()
2463 @staticmethod 2464 def write_many(objs, writer, singular=None, plural=None): 2465 if singular is None: 2466 singular = 'dynamic_cpu' 2467 if plural is None: 2468 plural = 'dynamic_cpus' 2469 writer.write_start(plural) 2470 if isinstance(objs, List): 2471 href = objs.href 2472 if href is not None: 2473 writer.write_attribute('href', href) 2474 for obj in objs: 2475 DynamicCpuWriter.write_one(obj, writer, singular) 2476 writer.write_end()
2479class EngineBackupInfoWriter(Writer): 2480 2481 def __init__(self): 2482 super(EngineBackupInfoWriter, self).__init__() 2483 2484 @staticmethod 2485 def write_one(obj, writer, singular=None): 2486 if singular is None: 2487 singular = 'engine_backup_info' 2488 writer.write_start(singular) 2489 href = obj.href 2490 if href is not None: 2491 writer.write_attribute('href', href) 2492 if obj.last_cinder_backup is not None: 2493 Writer.write_date(writer, 'last_cinder_backup', obj.last_cinder_backup) 2494 if obj.last_db_backup is not None: 2495 Writer.write_date(writer, 'last_db_backup', obj.last_db_backup) 2496 if obj.last_dwh_backup is not None: 2497 Writer.write_date(writer, 'last_dwh_backup', obj.last_dwh_backup) 2498 if obj.last_engine_backup is not None: 2499 Writer.write_date(writer, 'last_engine_backup', obj.last_engine_backup) 2500 if obj.last_grafana_backup is not None: 2501 Writer.write_date(writer, 'last_grafana_backup', obj.last_grafana_backup) 2502 if obj.last_keycloak_backup is not None: 2503 Writer.write_date(writer, 'last_keycloak_backup', obj.last_keycloak_backup) 2504 writer.write_end() 2505 2506 @staticmethod 2507 def write_many(objs, writer, singular=None, plural=None): 2508 if singular is None: 2509 singular = 'engine_backup_info' 2510 if plural is None: 2511 plural = 'engine_backup_infos' 2512 writer.write_start(plural) 2513 if isinstance(objs, List): 2514 href = objs.href 2515 if href is not None: 2516 writer.write_attribute('href', href) 2517 for obj in objs: 2518 EngineBackupInfoWriter.write_one(obj, writer, singular) 2519 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2484 @staticmethod 2485 def write_one(obj, writer, singular=None): 2486 if singular is None: 2487 singular = 'engine_backup_info' 2488 writer.write_start(singular) 2489 href = obj.href 2490 if href is not None: 2491 writer.write_attribute('href', href) 2492 if obj.last_cinder_backup is not None: 2493 Writer.write_date(writer, 'last_cinder_backup', obj.last_cinder_backup) 2494 if obj.last_db_backup is not None: 2495 Writer.write_date(writer, 'last_db_backup', obj.last_db_backup) 2496 if obj.last_dwh_backup is not None: 2497 Writer.write_date(writer, 'last_dwh_backup', obj.last_dwh_backup) 2498 if obj.last_engine_backup is not None: 2499 Writer.write_date(writer, 'last_engine_backup', obj.last_engine_backup) 2500 if obj.last_grafana_backup is not None: 2501 Writer.write_date(writer, 'last_grafana_backup', obj.last_grafana_backup) 2502 if obj.last_keycloak_backup is not None: 2503 Writer.write_date(writer, 'last_keycloak_backup', obj.last_keycloak_backup) 2504 writer.write_end()
2506 @staticmethod 2507 def write_many(objs, writer, singular=None, plural=None): 2508 if singular is None: 2509 singular = 'engine_backup_info' 2510 if plural is None: 2511 plural = 'engine_backup_infos' 2512 writer.write_start(plural) 2513 if isinstance(objs, List): 2514 href = objs.href 2515 if href is not None: 2516 writer.write_attribute('href', href) 2517 for obj in objs: 2518 EngineBackupInfoWriter.write_one(obj, writer, singular) 2519 writer.write_end()
2522class EntityProfileDetailWriter(Writer): 2523 2524 def __init__(self): 2525 super(EntityProfileDetailWriter, self).__init__() 2526 2527 @staticmethod 2528 def write_one(obj, writer, singular=None): 2529 if singular is None: 2530 singular = 'entity_profile_detail' 2531 writer.write_start(singular) 2532 href = obj.href 2533 if href is not None: 2534 writer.write_attribute('href', href) 2535 if obj.profile_details is not None: 2536 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 2537 writer.write_end() 2538 2539 @staticmethod 2540 def write_many(objs, writer, singular=None, plural=None): 2541 if singular is None: 2542 singular = 'entity_profile_detail' 2543 if plural is None: 2544 plural = 'entity_profile_details' 2545 writer.write_start(plural) 2546 if isinstance(objs, List): 2547 href = objs.href 2548 if href is not None: 2549 writer.write_attribute('href', href) 2550 for obj in objs: 2551 EntityProfileDetailWriter.write_one(obj, writer, singular) 2552 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2527 @staticmethod 2528 def write_one(obj, writer, singular=None): 2529 if singular is None: 2530 singular = 'entity_profile_detail' 2531 writer.write_start(singular) 2532 href = obj.href 2533 if href is not None: 2534 writer.write_attribute('href', href) 2535 if obj.profile_details is not None: 2536 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 2537 writer.write_end()
2539 @staticmethod 2540 def write_many(objs, writer, singular=None, plural=None): 2541 if singular is None: 2542 singular = 'entity_profile_detail' 2543 if plural is None: 2544 plural = 'entity_profile_details' 2545 writer.write_start(plural) 2546 if isinstance(objs, List): 2547 href = objs.href 2548 if href is not None: 2549 writer.write_attribute('href', href) 2550 for obj in objs: 2551 EntityProfileDetailWriter.write_one(obj, writer, singular) 2552 writer.write_end()
2555class ErrorHandlingWriter(Writer): 2556 2557 def __init__(self): 2558 super(ErrorHandlingWriter, self).__init__() 2559 2560 @staticmethod 2561 def write_one(obj, writer, singular=None): 2562 if singular is None: 2563 singular = 'error_handling' 2564 writer.write_start(singular) 2565 href = obj.href 2566 if href is not None: 2567 writer.write_attribute('href', href) 2568 if obj.on_error is not None: 2569 Writer.write_string(writer, 'on_error', obj.on_error.value) 2570 writer.write_end() 2571 2572 @staticmethod 2573 def write_many(objs, writer, singular=None, plural=None): 2574 if singular is None: 2575 singular = 'error_handling' 2576 if plural is None: 2577 plural = 'error_handlings' 2578 writer.write_start(plural) 2579 if isinstance(objs, List): 2580 href = objs.href 2581 if href is not None: 2582 writer.write_attribute('href', href) 2583 for obj in objs: 2584 ErrorHandlingWriter.write_one(obj, writer, singular) 2585 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2560 @staticmethod 2561 def write_one(obj, writer, singular=None): 2562 if singular is None: 2563 singular = 'error_handling' 2564 writer.write_start(singular) 2565 href = obj.href 2566 if href is not None: 2567 writer.write_attribute('href', href) 2568 if obj.on_error is not None: 2569 Writer.write_string(writer, 'on_error', obj.on_error.value) 2570 writer.write_end()
2572 @staticmethod 2573 def write_many(objs, writer, singular=None, plural=None): 2574 if singular is None: 2575 singular = 'error_handling' 2576 if plural is None: 2577 plural = 'error_handlings' 2578 writer.write_start(plural) 2579 if isinstance(objs, List): 2580 href = objs.href 2581 if href is not None: 2582 writer.write_attribute('href', href) 2583 for obj in objs: 2584 ErrorHandlingWriter.write_one(obj, writer, singular) 2585 writer.write_end()
2588class EventWriter(Writer): 2589 2590 def __init__(self): 2591 super(EventWriter, self).__init__() 2592 2593 @staticmethod 2594 def write_one(obj, writer, singular=None): 2595 if singular is None: 2596 singular = 'event' 2597 writer.write_start(singular) 2598 href = obj.href 2599 if href is not None: 2600 writer.write_attribute('href', href) 2601 if obj.id is not None: 2602 writer.write_attribute('id', obj.id) 2603 if obj.code is not None: 2604 Writer.write_integer(writer, 'code', obj.code) 2605 if obj.comment is not None: 2606 Writer.write_string(writer, 'comment', obj.comment) 2607 if obj.correlation_id is not None: 2608 Writer.write_string(writer, 'correlation_id', obj.correlation_id) 2609 if obj.custom_data is not None: 2610 Writer.write_string(writer, 'custom_data', obj.custom_data) 2611 if obj.custom_id is not None: 2612 Writer.write_integer(writer, 'custom_id', obj.custom_id) 2613 if obj.description is not None: 2614 Writer.write_string(writer, 'description', obj.description) 2615 if obj.flood_rate is not None: 2616 Writer.write_integer(writer, 'flood_rate', obj.flood_rate) 2617 if obj.index is not None: 2618 Writer.write_integer(writer, 'index', obj.index) 2619 if obj.log_on_host is not None: 2620 Writer.write_boolean(writer, 'log_on_host', obj.log_on_host) 2621 if obj.name is not None: 2622 Writer.write_string(writer, 'name', obj.name) 2623 if obj.origin is not None: 2624 Writer.write_string(writer, 'origin', obj.origin) 2625 if obj.severity is not None: 2626 Writer.write_string(writer, 'severity', obj.severity.value) 2627 if obj.time is not None: 2628 Writer.write_date(writer, 'time', obj.time) 2629 if obj.cluster is not None: 2630 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 2631 if obj.data_center is not None: 2632 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 2633 if obj.host is not None: 2634 HostWriter.write_one(obj.host, writer, 'host') 2635 if obj.storage_domain is not None: 2636 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2637 if obj.template is not None: 2638 TemplateWriter.write_one(obj.template, writer, 'template') 2639 if obj.user is not None: 2640 UserWriter.write_one(obj.user, writer, 'user') 2641 if obj.vm is not None: 2642 VmWriter.write_one(obj.vm, writer, 'vm') 2643 writer.write_end() 2644 2645 @staticmethod 2646 def write_many(objs, writer, singular=None, plural=None): 2647 if singular is None: 2648 singular = 'event' 2649 if plural is None: 2650 plural = 'events' 2651 writer.write_start(plural) 2652 if isinstance(objs, List): 2653 href = objs.href 2654 if href is not None: 2655 writer.write_attribute('href', href) 2656 for obj in objs: 2657 EventWriter.write_one(obj, writer, singular) 2658 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2593 @staticmethod 2594 def write_one(obj, writer, singular=None): 2595 if singular is None: 2596 singular = 'event' 2597 writer.write_start(singular) 2598 href = obj.href 2599 if href is not None: 2600 writer.write_attribute('href', href) 2601 if obj.id is not None: 2602 writer.write_attribute('id', obj.id) 2603 if obj.code is not None: 2604 Writer.write_integer(writer, 'code', obj.code) 2605 if obj.comment is not None: 2606 Writer.write_string(writer, 'comment', obj.comment) 2607 if obj.correlation_id is not None: 2608 Writer.write_string(writer, 'correlation_id', obj.correlation_id) 2609 if obj.custom_data is not None: 2610 Writer.write_string(writer, 'custom_data', obj.custom_data) 2611 if obj.custom_id is not None: 2612 Writer.write_integer(writer, 'custom_id', obj.custom_id) 2613 if obj.description is not None: 2614 Writer.write_string(writer, 'description', obj.description) 2615 if obj.flood_rate is not None: 2616 Writer.write_integer(writer, 'flood_rate', obj.flood_rate) 2617 if obj.index is not None: 2618 Writer.write_integer(writer, 'index', obj.index) 2619 if obj.log_on_host is not None: 2620 Writer.write_boolean(writer, 'log_on_host', obj.log_on_host) 2621 if obj.name is not None: 2622 Writer.write_string(writer, 'name', obj.name) 2623 if obj.origin is not None: 2624 Writer.write_string(writer, 'origin', obj.origin) 2625 if obj.severity is not None: 2626 Writer.write_string(writer, 'severity', obj.severity.value) 2627 if obj.time is not None: 2628 Writer.write_date(writer, 'time', obj.time) 2629 if obj.cluster is not None: 2630 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 2631 if obj.data_center is not None: 2632 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 2633 if obj.host is not None: 2634 HostWriter.write_one(obj.host, writer, 'host') 2635 if obj.storage_domain is not None: 2636 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 2637 if obj.template is not None: 2638 TemplateWriter.write_one(obj.template, writer, 'template') 2639 if obj.user is not None: 2640 UserWriter.write_one(obj.user, writer, 'user') 2641 if obj.vm is not None: 2642 VmWriter.write_one(obj.vm, writer, 'vm') 2643 writer.write_end()
2645 @staticmethod 2646 def write_many(objs, writer, singular=None, plural=None): 2647 if singular is None: 2648 singular = 'event' 2649 if plural is None: 2650 plural = 'events' 2651 writer.write_start(plural) 2652 if isinstance(objs, List): 2653 href = objs.href 2654 if href is not None: 2655 writer.write_attribute('href', href) 2656 for obj in objs: 2657 EventWriter.write_one(obj, writer, singular) 2658 writer.write_end()
2661class EventSubscriptionWriter(Writer): 2662 2663 def __init__(self): 2664 super(EventSubscriptionWriter, self).__init__() 2665 2666 @staticmethod 2667 def write_one(obj, writer, singular=None): 2668 if singular is None: 2669 singular = 'event_subscription' 2670 writer.write_start(singular) 2671 href = obj.href 2672 if href is not None: 2673 writer.write_attribute('href', href) 2674 if obj.id is not None: 2675 writer.write_attribute('id', obj.id) 2676 if obj.address is not None: 2677 Writer.write_string(writer, 'address', obj.address) 2678 if obj.comment is not None: 2679 Writer.write_string(writer, 'comment', obj.comment) 2680 if obj.description is not None: 2681 Writer.write_string(writer, 'description', obj.description) 2682 if obj.event is not None: 2683 Writer.write_string(writer, 'event', obj.event.value) 2684 if obj.name is not None: 2685 Writer.write_string(writer, 'name', obj.name) 2686 if obj.notification_method is not None: 2687 Writer.write_string(writer, 'notification_method', obj.notification_method.value) 2688 if obj.user is not None: 2689 UserWriter.write_one(obj.user, writer, 'user') 2690 writer.write_end() 2691 2692 @staticmethod 2693 def write_many(objs, writer, singular=None, plural=None): 2694 if singular is None: 2695 singular = 'event_subscription' 2696 if plural is None: 2697 plural = 'event_subscriptions' 2698 writer.write_start(plural) 2699 if isinstance(objs, List): 2700 href = objs.href 2701 if href is not None: 2702 writer.write_attribute('href', href) 2703 for obj in objs: 2704 EventSubscriptionWriter.write_one(obj, writer, singular) 2705 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2666 @staticmethod 2667 def write_one(obj, writer, singular=None): 2668 if singular is None: 2669 singular = 'event_subscription' 2670 writer.write_start(singular) 2671 href = obj.href 2672 if href is not None: 2673 writer.write_attribute('href', href) 2674 if obj.id is not None: 2675 writer.write_attribute('id', obj.id) 2676 if obj.address is not None: 2677 Writer.write_string(writer, 'address', obj.address) 2678 if obj.comment is not None: 2679 Writer.write_string(writer, 'comment', obj.comment) 2680 if obj.description is not None: 2681 Writer.write_string(writer, 'description', obj.description) 2682 if obj.event is not None: 2683 Writer.write_string(writer, 'event', obj.event.value) 2684 if obj.name is not None: 2685 Writer.write_string(writer, 'name', obj.name) 2686 if obj.notification_method is not None: 2687 Writer.write_string(writer, 'notification_method', obj.notification_method.value) 2688 if obj.user is not None: 2689 UserWriter.write_one(obj.user, writer, 'user') 2690 writer.write_end()
2692 @staticmethod 2693 def write_many(objs, writer, singular=None, plural=None): 2694 if singular is None: 2695 singular = 'event_subscription' 2696 if plural is None: 2697 plural = 'event_subscriptions' 2698 writer.write_start(plural) 2699 if isinstance(objs, List): 2700 href = objs.href 2701 if href is not None: 2702 writer.write_attribute('href', href) 2703 for obj in objs: 2704 EventSubscriptionWriter.write_one(obj, writer, singular) 2705 writer.write_end()
2708class ExternalComputeResourceWriter(Writer): 2709 2710 def __init__(self): 2711 super(ExternalComputeResourceWriter, self).__init__() 2712 2713 @staticmethod 2714 def write_one(obj, writer, singular=None): 2715 if singular is None: 2716 singular = 'external_compute_resource' 2717 writer.write_start(singular) 2718 href = obj.href 2719 if href is not None: 2720 writer.write_attribute('href', href) 2721 if obj.id is not None: 2722 writer.write_attribute('id', obj.id) 2723 if obj.comment is not None: 2724 Writer.write_string(writer, 'comment', obj.comment) 2725 if obj.description is not None: 2726 Writer.write_string(writer, 'description', obj.description) 2727 if obj.name is not None: 2728 Writer.write_string(writer, 'name', obj.name) 2729 if obj.provider is not None: 2730 Writer.write_string(writer, 'provider', obj.provider) 2731 if obj.url is not None: 2732 Writer.write_string(writer, 'url', obj.url) 2733 if obj.user is not None: 2734 Writer.write_string(writer, 'user', obj.user) 2735 if obj.external_host_provider is not None: 2736 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2737 writer.write_end() 2738 2739 @staticmethod 2740 def write_many(objs, writer, singular=None, plural=None): 2741 if singular is None: 2742 singular = 'external_compute_resource' 2743 if plural is None: 2744 plural = 'external_compute_resources' 2745 writer.write_start(plural) 2746 if isinstance(objs, List): 2747 href = objs.href 2748 if href is not None: 2749 writer.write_attribute('href', href) 2750 for obj in objs: 2751 ExternalComputeResourceWriter.write_one(obj, writer, singular) 2752 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2713 @staticmethod 2714 def write_one(obj, writer, singular=None): 2715 if singular is None: 2716 singular = 'external_compute_resource' 2717 writer.write_start(singular) 2718 href = obj.href 2719 if href is not None: 2720 writer.write_attribute('href', href) 2721 if obj.id is not None: 2722 writer.write_attribute('id', obj.id) 2723 if obj.comment is not None: 2724 Writer.write_string(writer, 'comment', obj.comment) 2725 if obj.description is not None: 2726 Writer.write_string(writer, 'description', obj.description) 2727 if obj.name is not None: 2728 Writer.write_string(writer, 'name', obj.name) 2729 if obj.provider is not None: 2730 Writer.write_string(writer, 'provider', obj.provider) 2731 if obj.url is not None: 2732 Writer.write_string(writer, 'url', obj.url) 2733 if obj.user is not None: 2734 Writer.write_string(writer, 'user', obj.user) 2735 if obj.external_host_provider is not None: 2736 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2737 writer.write_end()
2739 @staticmethod 2740 def write_many(objs, writer, singular=None, plural=None): 2741 if singular is None: 2742 singular = 'external_compute_resource' 2743 if plural is None: 2744 plural = 'external_compute_resources' 2745 writer.write_start(plural) 2746 if isinstance(objs, List): 2747 href = objs.href 2748 if href is not None: 2749 writer.write_attribute('href', href) 2750 for obj in objs: 2751 ExternalComputeResourceWriter.write_one(obj, writer, singular) 2752 writer.write_end()
2755class ExternalDiscoveredHostWriter(Writer): 2756 2757 def __init__(self): 2758 super(ExternalDiscoveredHostWriter, self).__init__() 2759 2760 @staticmethod 2761 def write_one(obj, writer, singular=None): 2762 if singular is None: 2763 singular = 'external_discovered_host' 2764 writer.write_start(singular) 2765 href = obj.href 2766 if href is not None: 2767 writer.write_attribute('href', href) 2768 if obj.id is not None: 2769 writer.write_attribute('id', obj.id) 2770 if obj.comment is not None: 2771 Writer.write_string(writer, 'comment', obj.comment) 2772 if obj.description is not None: 2773 Writer.write_string(writer, 'description', obj.description) 2774 if obj.ip is not None: 2775 Writer.write_string(writer, 'ip', obj.ip) 2776 if obj.last_report is not None: 2777 Writer.write_string(writer, 'last_report', obj.last_report) 2778 if obj.mac is not None: 2779 Writer.write_string(writer, 'mac', obj.mac) 2780 if obj.name is not None: 2781 Writer.write_string(writer, 'name', obj.name) 2782 if obj.subnet_name is not None: 2783 Writer.write_string(writer, 'subnet_name', obj.subnet_name) 2784 if obj.external_host_provider is not None: 2785 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2786 writer.write_end() 2787 2788 @staticmethod 2789 def write_many(objs, writer, singular=None, plural=None): 2790 if singular is None: 2791 singular = 'external_discovered_host' 2792 if plural is None: 2793 plural = 'external_discovered_hosts' 2794 writer.write_start(plural) 2795 if isinstance(objs, List): 2796 href = objs.href 2797 if href is not None: 2798 writer.write_attribute('href', href) 2799 for obj in objs: 2800 ExternalDiscoveredHostWriter.write_one(obj, writer, singular) 2801 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2760 @staticmethod 2761 def write_one(obj, writer, singular=None): 2762 if singular is None: 2763 singular = 'external_discovered_host' 2764 writer.write_start(singular) 2765 href = obj.href 2766 if href is not None: 2767 writer.write_attribute('href', href) 2768 if obj.id is not None: 2769 writer.write_attribute('id', obj.id) 2770 if obj.comment is not None: 2771 Writer.write_string(writer, 'comment', obj.comment) 2772 if obj.description is not None: 2773 Writer.write_string(writer, 'description', obj.description) 2774 if obj.ip is not None: 2775 Writer.write_string(writer, 'ip', obj.ip) 2776 if obj.last_report is not None: 2777 Writer.write_string(writer, 'last_report', obj.last_report) 2778 if obj.mac is not None: 2779 Writer.write_string(writer, 'mac', obj.mac) 2780 if obj.name is not None: 2781 Writer.write_string(writer, 'name', obj.name) 2782 if obj.subnet_name is not None: 2783 Writer.write_string(writer, 'subnet_name', obj.subnet_name) 2784 if obj.external_host_provider is not None: 2785 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2786 writer.write_end()
2788 @staticmethod 2789 def write_many(objs, writer, singular=None, plural=None): 2790 if singular is None: 2791 singular = 'external_discovered_host' 2792 if plural is None: 2793 plural = 'external_discovered_hosts' 2794 writer.write_start(plural) 2795 if isinstance(objs, List): 2796 href = objs.href 2797 if href is not None: 2798 writer.write_attribute('href', href) 2799 for obj in objs: 2800 ExternalDiscoveredHostWriter.write_one(obj, writer, singular) 2801 writer.write_end()
2804class ExternalHostWriter(Writer): 2805 2806 def __init__(self): 2807 super(ExternalHostWriter, self).__init__() 2808 2809 @staticmethod 2810 def write_one(obj, writer, singular=None): 2811 if singular is None: 2812 singular = 'external_host' 2813 writer.write_start(singular) 2814 href = obj.href 2815 if href is not None: 2816 writer.write_attribute('href', href) 2817 if obj.id is not None: 2818 writer.write_attribute('id', obj.id) 2819 if obj.address is not None: 2820 Writer.write_string(writer, 'address', obj.address) 2821 if obj.comment is not None: 2822 Writer.write_string(writer, 'comment', obj.comment) 2823 if obj.description is not None: 2824 Writer.write_string(writer, 'description', obj.description) 2825 if obj.name is not None: 2826 Writer.write_string(writer, 'name', obj.name) 2827 if obj.external_host_provider is not None: 2828 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2829 writer.write_end() 2830 2831 @staticmethod 2832 def write_many(objs, writer, singular=None, plural=None): 2833 if singular is None: 2834 singular = 'external_host' 2835 if plural is None: 2836 plural = 'external_hosts' 2837 writer.write_start(plural) 2838 if isinstance(objs, List): 2839 href = objs.href 2840 if href is not None: 2841 writer.write_attribute('href', href) 2842 for obj in objs: 2843 ExternalHostWriter.write_one(obj, writer, singular) 2844 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2809 @staticmethod 2810 def write_one(obj, writer, singular=None): 2811 if singular is None: 2812 singular = 'external_host' 2813 writer.write_start(singular) 2814 href = obj.href 2815 if href is not None: 2816 writer.write_attribute('href', href) 2817 if obj.id is not None: 2818 writer.write_attribute('id', obj.id) 2819 if obj.address is not None: 2820 Writer.write_string(writer, 'address', obj.address) 2821 if obj.comment is not None: 2822 Writer.write_string(writer, 'comment', obj.comment) 2823 if obj.description is not None: 2824 Writer.write_string(writer, 'description', obj.description) 2825 if obj.name is not None: 2826 Writer.write_string(writer, 'name', obj.name) 2827 if obj.external_host_provider is not None: 2828 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2829 writer.write_end()
2831 @staticmethod 2832 def write_many(objs, writer, singular=None, plural=None): 2833 if singular is None: 2834 singular = 'external_host' 2835 if plural is None: 2836 plural = 'external_hosts' 2837 writer.write_start(plural) 2838 if isinstance(objs, List): 2839 href = objs.href 2840 if href is not None: 2841 writer.write_attribute('href', href) 2842 for obj in objs: 2843 ExternalHostWriter.write_one(obj, writer, singular) 2844 writer.write_end()
2847class ExternalHostGroupWriter(Writer): 2848 2849 def __init__(self): 2850 super(ExternalHostGroupWriter, self).__init__() 2851 2852 @staticmethod 2853 def write_one(obj, writer, singular=None): 2854 if singular is None: 2855 singular = 'external_host_group' 2856 writer.write_start(singular) 2857 href = obj.href 2858 if href is not None: 2859 writer.write_attribute('href', href) 2860 if obj.id is not None: 2861 writer.write_attribute('id', obj.id) 2862 if obj.architecture_name is not None: 2863 Writer.write_string(writer, 'architecture_name', obj.architecture_name) 2864 if obj.comment is not None: 2865 Writer.write_string(writer, 'comment', obj.comment) 2866 if obj.description is not None: 2867 Writer.write_string(writer, 'description', obj.description) 2868 if obj.domain_name is not None: 2869 Writer.write_string(writer, 'domain_name', obj.domain_name) 2870 if obj.name is not None: 2871 Writer.write_string(writer, 'name', obj.name) 2872 if obj.operating_system_name is not None: 2873 Writer.write_string(writer, 'operating_system_name', obj.operating_system_name) 2874 if obj.subnet_name is not None: 2875 Writer.write_string(writer, 'subnet_name', obj.subnet_name) 2876 if obj.external_host_provider is not None: 2877 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2878 writer.write_end() 2879 2880 @staticmethod 2881 def write_many(objs, writer, singular=None, plural=None): 2882 if singular is None: 2883 singular = 'external_host_group' 2884 if plural is None: 2885 plural = 'external_host_groups' 2886 writer.write_start(plural) 2887 if isinstance(objs, List): 2888 href = objs.href 2889 if href is not None: 2890 writer.write_attribute('href', href) 2891 for obj in objs: 2892 ExternalHostGroupWriter.write_one(obj, writer, singular) 2893 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2852 @staticmethod 2853 def write_one(obj, writer, singular=None): 2854 if singular is None: 2855 singular = 'external_host_group' 2856 writer.write_start(singular) 2857 href = obj.href 2858 if href is not None: 2859 writer.write_attribute('href', href) 2860 if obj.id is not None: 2861 writer.write_attribute('id', obj.id) 2862 if obj.architecture_name is not None: 2863 Writer.write_string(writer, 'architecture_name', obj.architecture_name) 2864 if obj.comment is not None: 2865 Writer.write_string(writer, 'comment', obj.comment) 2866 if obj.description is not None: 2867 Writer.write_string(writer, 'description', obj.description) 2868 if obj.domain_name is not None: 2869 Writer.write_string(writer, 'domain_name', obj.domain_name) 2870 if obj.name is not None: 2871 Writer.write_string(writer, 'name', obj.name) 2872 if obj.operating_system_name is not None: 2873 Writer.write_string(writer, 'operating_system_name', obj.operating_system_name) 2874 if obj.subnet_name is not None: 2875 Writer.write_string(writer, 'subnet_name', obj.subnet_name) 2876 if obj.external_host_provider is not None: 2877 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 2878 writer.write_end()
2880 @staticmethod 2881 def write_many(objs, writer, singular=None, plural=None): 2882 if singular is None: 2883 singular = 'external_host_group' 2884 if plural is None: 2885 plural = 'external_host_groups' 2886 writer.write_start(plural) 2887 if isinstance(objs, List): 2888 href = objs.href 2889 if href is not None: 2890 writer.write_attribute('href', href) 2891 for obj in objs: 2892 ExternalHostGroupWriter.write_one(obj, writer, singular) 2893 writer.write_end()
2896class ExternalHostProviderWriter(Writer): 2897 2898 def __init__(self): 2899 super(ExternalHostProviderWriter, self).__init__() 2900 2901 @staticmethod 2902 def write_one(obj, writer, singular=None): 2903 if singular is None: 2904 singular = 'external_host_provider' 2905 writer.write_start(singular) 2906 href = obj.href 2907 if href is not None: 2908 writer.write_attribute('href', href) 2909 if obj.id is not None: 2910 writer.write_attribute('id', obj.id) 2911 if obj.authentication_url is not None: 2912 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 2913 if obj.comment is not None: 2914 Writer.write_string(writer, 'comment', obj.comment) 2915 if obj.description is not None: 2916 Writer.write_string(writer, 'description', obj.description) 2917 if obj.name is not None: 2918 Writer.write_string(writer, 'name', obj.name) 2919 if obj.password is not None: 2920 Writer.write_string(writer, 'password', obj.password) 2921 if obj.properties is not None: 2922 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 2923 if obj.requires_authentication is not None: 2924 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 2925 if obj.url is not None: 2926 Writer.write_string(writer, 'url', obj.url) 2927 if obj.username is not None: 2928 Writer.write_string(writer, 'username', obj.username) 2929 if obj.certificates is not None: 2930 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 2931 if obj.compute_resources is not None: 2932 ExternalComputeResourceWriter.write_many(obj.compute_resources, writer, 'external_compute_resource', 'compute_resources') 2933 if obj.discovered_hosts is not None: 2934 ExternalDiscoveredHostWriter.write_many(obj.discovered_hosts, writer, 'external_discovered_host', 'discovered_hosts') 2935 if obj.host_groups is not None: 2936 ExternalHostGroupWriter.write_many(obj.host_groups, writer, 'external_host_group', 'host_groups') 2937 if obj.hosts is not None: 2938 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 2939 writer.write_end() 2940 2941 @staticmethod 2942 def write_many(objs, writer, singular=None, plural=None): 2943 if singular is None: 2944 singular = 'external_host_provider' 2945 if plural is None: 2946 plural = 'external_host_providers' 2947 writer.write_start(plural) 2948 if isinstance(objs, List): 2949 href = objs.href 2950 if href is not None: 2951 writer.write_attribute('href', href) 2952 for obj in objs: 2953 ExternalHostProviderWriter.write_one(obj, writer, singular) 2954 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2901 @staticmethod 2902 def write_one(obj, writer, singular=None): 2903 if singular is None: 2904 singular = 'external_host_provider' 2905 writer.write_start(singular) 2906 href = obj.href 2907 if href is not None: 2908 writer.write_attribute('href', href) 2909 if obj.id is not None: 2910 writer.write_attribute('id', obj.id) 2911 if obj.authentication_url is not None: 2912 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 2913 if obj.comment is not None: 2914 Writer.write_string(writer, 'comment', obj.comment) 2915 if obj.description is not None: 2916 Writer.write_string(writer, 'description', obj.description) 2917 if obj.name is not None: 2918 Writer.write_string(writer, 'name', obj.name) 2919 if obj.password is not None: 2920 Writer.write_string(writer, 'password', obj.password) 2921 if obj.properties is not None: 2922 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 2923 if obj.requires_authentication is not None: 2924 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 2925 if obj.url is not None: 2926 Writer.write_string(writer, 'url', obj.url) 2927 if obj.username is not None: 2928 Writer.write_string(writer, 'username', obj.username) 2929 if obj.certificates is not None: 2930 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 2931 if obj.compute_resources is not None: 2932 ExternalComputeResourceWriter.write_many(obj.compute_resources, writer, 'external_compute_resource', 'compute_resources') 2933 if obj.discovered_hosts is not None: 2934 ExternalDiscoveredHostWriter.write_many(obj.discovered_hosts, writer, 'external_discovered_host', 'discovered_hosts') 2935 if obj.host_groups is not None: 2936 ExternalHostGroupWriter.write_many(obj.host_groups, writer, 'external_host_group', 'host_groups') 2937 if obj.hosts is not None: 2938 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 2939 writer.write_end()
2941 @staticmethod 2942 def write_many(objs, writer, singular=None, plural=None): 2943 if singular is None: 2944 singular = 'external_host_provider' 2945 if plural is None: 2946 plural = 'external_host_providers' 2947 writer.write_start(plural) 2948 if isinstance(objs, List): 2949 href = objs.href 2950 if href is not None: 2951 writer.write_attribute('href', href) 2952 for obj in objs: 2953 ExternalHostProviderWriter.write_one(obj, writer, singular) 2954 writer.write_end()
2957class ExternalNetworkProviderConfigurationWriter(Writer): 2958 2959 def __init__(self): 2960 super(ExternalNetworkProviderConfigurationWriter, self).__init__() 2961 2962 @staticmethod 2963 def write_one(obj, writer, singular=None): 2964 if singular is None: 2965 singular = 'external_network_provider_configuration' 2966 writer.write_start(singular) 2967 href = obj.href 2968 if href is not None: 2969 writer.write_attribute('href', href) 2970 if obj.id is not None: 2971 writer.write_attribute('id', obj.id) 2972 if obj.comment is not None: 2973 Writer.write_string(writer, 'comment', obj.comment) 2974 if obj.description is not None: 2975 Writer.write_string(writer, 'description', obj.description) 2976 if obj.name is not None: 2977 Writer.write_string(writer, 'name', obj.name) 2978 if obj.external_network_provider is not None: 2979 ExternalProviderWriter.write_one(obj.external_network_provider, writer, 'external_network_provider') 2980 if obj.host is not None: 2981 HostWriter.write_one(obj.host, writer, 'host') 2982 writer.write_end() 2983 2984 @staticmethod 2985 def write_many(objs, writer, singular=None, plural=None): 2986 if singular is None: 2987 singular = 'external_network_provider_configuration' 2988 if plural is None: 2989 plural = 'external_network_provider_configurations' 2990 writer.write_start(plural) 2991 if isinstance(objs, List): 2992 href = objs.href 2993 if href is not None: 2994 writer.write_attribute('href', href) 2995 for obj in objs: 2996 ExternalNetworkProviderConfigurationWriter.write_one(obj, writer, singular) 2997 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
2962 @staticmethod 2963 def write_one(obj, writer, singular=None): 2964 if singular is None: 2965 singular = 'external_network_provider_configuration' 2966 writer.write_start(singular) 2967 href = obj.href 2968 if href is not None: 2969 writer.write_attribute('href', href) 2970 if obj.id is not None: 2971 writer.write_attribute('id', obj.id) 2972 if obj.comment is not None: 2973 Writer.write_string(writer, 'comment', obj.comment) 2974 if obj.description is not None: 2975 Writer.write_string(writer, 'description', obj.description) 2976 if obj.name is not None: 2977 Writer.write_string(writer, 'name', obj.name) 2978 if obj.external_network_provider is not None: 2979 ExternalProviderWriter.write_one(obj.external_network_provider, writer, 'external_network_provider') 2980 if obj.host is not None: 2981 HostWriter.write_one(obj.host, writer, 'host') 2982 writer.write_end()
2984 @staticmethod 2985 def write_many(objs, writer, singular=None, plural=None): 2986 if singular is None: 2987 singular = 'external_network_provider_configuration' 2988 if plural is None: 2989 plural = 'external_network_provider_configurations' 2990 writer.write_start(plural) 2991 if isinstance(objs, List): 2992 href = objs.href 2993 if href is not None: 2994 writer.write_attribute('href', href) 2995 for obj in objs: 2996 ExternalNetworkProviderConfigurationWriter.write_one(obj, writer, singular) 2997 writer.write_end()
3000class ExternalProviderWriter(Writer): 3001 3002 def __init__(self): 3003 super(ExternalProviderWriter, self).__init__() 3004 3005 @staticmethod 3006 def write_one(obj, writer, singular=None): 3007 if singular is None: 3008 singular = 'external_provider' 3009 writer.write_start(singular) 3010 href = obj.href 3011 if href is not None: 3012 writer.write_attribute('href', href) 3013 if obj.id is not None: 3014 writer.write_attribute('id', obj.id) 3015 if obj.authentication_url is not None: 3016 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 3017 if obj.comment is not None: 3018 Writer.write_string(writer, 'comment', obj.comment) 3019 if obj.description is not None: 3020 Writer.write_string(writer, 'description', obj.description) 3021 if obj.name is not None: 3022 Writer.write_string(writer, 'name', obj.name) 3023 if obj.password is not None: 3024 Writer.write_string(writer, 'password', obj.password) 3025 if obj.properties is not None: 3026 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 3027 if obj.requires_authentication is not None: 3028 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 3029 if obj.url is not None: 3030 Writer.write_string(writer, 'url', obj.url) 3031 if obj.username is not None: 3032 Writer.write_string(writer, 'username', obj.username) 3033 writer.write_end() 3034 3035 @staticmethod 3036 def write_many(objs, writer, singular=None, plural=None): 3037 if singular is None: 3038 singular = 'external_provider' 3039 if plural is None: 3040 plural = 'external_providers' 3041 writer.write_start(plural) 3042 if isinstance(objs, List): 3043 href = objs.href 3044 if href is not None: 3045 writer.write_attribute('href', href) 3046 for obj in objs: 3047 ExternalProviderWriter.write_one(obj, writer, singular) 3048 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3005 @staticmethod 3006 def write_one(obj, writer, singular=None): 3007 if singular is None: 3008 singular = 'external_provider' 3009 writer.write_start(singular) 3010 href = obj.href 3011 if href is not None: 3012 writer.write_attribute('href', href) 3013 if obj.id is not None: 3014 writer.write_attribute('id', obj.id) 3015 if obj.authentication_url is not None: 3016 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 3017 if obj.comment is not None: 3018 Writer.write_string(writer, 'comment', obj.comment) 3019 if obj.description is not None: 3020 Writer.write_string(writer, 'description', obj.description) 3021 if obj.name is not None: 3022 Writer.write_string(writer, 'name', obj.name) 3023 if obj.password is not None: 3024 Writer.write_string(writer, 'password', obj.password) 3025 if obj.properties is not None: 3026 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 3027 if obj.requires_authentication is not None: 3028 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 3029 if obj.url is not None: 3030 Writer.write_string(writer, 'url', obj.url) 3031 if obj.username is not None: 3032 Writer.write_string(writer, 'username', obj.username) 3033 writer.write_end()
3035 @staticmethod 3036 def write_many(objs, writer, singular=None, plural=None): 3037 if singular is None: 3038 singular = 'external_provider' 3039 if plural is None: 3040 plural = 'external_providers' 3041 writer.write_start(plural) 3042 if isinstance(objs, List): 3043 href = objs.href 3044 if href is not None: 3045 writer.write_attribute('href', href) 3046 for obj in objs: 3047 ExternalProviderWriter.write_one(obj, writer, singular) 3048 writer.write_end()
3051class ExternalTemplateImportWriter(Writer): 3052 3053 def __init__(self): 3054 super(ExternalTemplateImportWriter, self).__init__() 3055 3056 @staticmethod 3057 def write_one(obj, writer, singular=None): 3058 if singular is None: 3059 singular = 'external_template_import' 3060 writer.write_start(singular) 3061 href = obj.href 3062 if href is not None: 3063 writer.write_attribute('href', href) 3064 if obj.clone is not None: 3065 Writer.write_boolean(writer, 'clone', obj.clone) 3066 if obj.url is not None: 3067 Writer.write_string(writer, 'url', obj.url) 3068 if obj.cluster is not None: 3069 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3070 if obj.cpu_profile is not None: 3071 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 3072 if obj.host is not None: 3073 HostWriter.write_one(obj.host, writer, 'host') 3074 if obj.quota is not None: 3075 QuotaWriter.write_one(obj.quota, writer, 'quota') 3076 if obj.storage_domain is not None: 3077 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3078 if obj.template is not None: 3079 TemplateWriter.write_one(obj.template, writer, 'template') 3080 writer.write_end() 3081 3082 @staticmethod 3083 def write_many(objs, writer, singular=None, plural=None): 3084 if singular is None: 3085 singular = 'external_template_import' 3086 if plural is None: 3087 plural = 'external_template_imports' 3088 writer.write_start(plural) 3089 if isinstance(objs, List): 3090 href = objs.href 3091 if href is not None: 3092 writer.write_attribute('href', href) 3093 for obj in objs: 3094 ExternalTemplateImportWriter.write_one(obj, writer, singular) 3095 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3056 @staticmethod 3057 def write_one(obj, writer, singular=None): 3058 if singular is None: 3059 singular = 'external_template_import' 3060 writer.write_start(singular) 3061 href = obj.href 3062 if href is not None: 3063 writer.write_attribute('href', href) 3064 if obj.clone is not None: 3065 Writer.write_boolean(writer, 'clone', obj.clone) 3066 if obj.url is not None: 3067 Writer.write_string(writer, 'url', obj.url) 3068 if obj.cluster is not None: 3069 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3070 if obj.cpu_profile is not None: 3071 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 3072 if obj.host is not None: 3073 HostWriter.write_one(obj.host, writer, 'host') 3074 if obj.quota is not None: 3075 QuotaWriter.write_one(obj.quota, writer, 'quota') 3076 if obj.storage_domain is not None: 3077 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3078 if obj.template is not None: 3079 TemplateWriter.write_one(obj.template, writer, 'template') 3080 writer.write_end()
3082 @staticmethod 3083 def write_many(objs, writer, singular=None, plural=None): 3084 if singular is None: 3085 singular = 'external_template_import' 3086 if plural is None: 3087 plural = 'external_template_imports' 3088 writer.write_start(plural) 3089 if isinstance(objs, List): 3090 href = objs.href 3091 if href is not None: 3092 writer.write_attribute('href', href) 3093 for obj in objs: 3094 ExternalTemplateImportWriter.write_one(obj, writer, singular) 3095 writer.write_end()
3098class ExternalVmImportWriter(Writer): 3099 3100 def __init__(self): 3101 super(ExternalVmImportWriter, self).__init__() 3102 3103 @staticmethod 3104 def write_one(obj, writer, singular=None): 3105 if singular is None: 3106 singular = 'external_vm_import' 3107 writer.write_start(singular) 3108 href = obj.href 3109 if href is not None: 3110 writer.write_attribute('href', href) 3111 if obj.name is not None: 3112 Writer.write_string(writer, 'name', obj.name) 3113 if obj.password is not None: 3114 Writer.write_string(writer, 'password', obj.password) 3115 if obj.provider is not None: 3116 Writer.write_string(writer, 'provider', obj.provider.value) 3117 if obj.sparse is not None: 3118 Writer.write_boolean(writer, 'sparse', obj.sparse) 3119 if obj.url is not None: 3120 Writer.write_string(writer, 'url', obj.url) 3121 if obj.username is not None: 3122 Writer.write_string(writer, 'username', obj.username) 3123 if obj.cluster is not None: 3124 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3125 if obj.cpu_profile is not None: 3126 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 3127 if obj.drivers_iso is not None: 3128 FileWriter.write_one(obj.drivers_iso, writer, 'drivers_iso') 3129 if obj.host is not None: 3130 HostWriter.write_one(obj.host, writer, 'host') 3131 if obj.quota is not None: 3132 QuotaWriter.write_one(obj.quota, writer, 'quota') 3133 if obj.storage_domain is not None: 3134 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3135 if obj.vm is not None: 3136 VmWriter.write_one(obj.vm, writer, 'vm') 3137 writer.write_end() 3138 3139 @staticmethod 3140 def write_many(objs, writer, singular=None, plural=None): 3141 if singular is None: 3142 singular = 'external_vm_import' 3143 if plural is None: 3144 plural = 'external_vm_imports' 3145 writer.write_start(plural) 3146 if isinstance(objs, List): 3147 href = objs.href 3148 if href is not None: 3149 writer.write_attribute('href', href) 3150 for obj in objs: 3151 ExternalVmImportWriter.write_one(obj, writer, singular) 3152 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3103 @staticmethod 3104 def write_one(obj, writer, singular=None): 3105 if singular is None: 3106 singular = 'external_vm_import' 3107 writer.write_start(singular) 3108 href = obj.href 3109 if href is not None: 3110 writer.write_attribute('href', href) 3111 if obj.name is not None: 3112 Writer.write_string(writer, 'name', obj.name) 3113 if obj.password is not None: 3114 Writer.write_string(writer, 'password', obj.password) 3115 if obj.provider is not None: 3116 Writer.write_string(writer, 'provider', obj.provider.value) 3117 if obj.sparse is not None: 3118 Writer.write_boolean(writer, 'sparse', obj.sparse) 3119 if obj.url is not None: 3120 Writer.write_string(writer, 'url', obj.url) 3121 if obj.username is not None: 3122 Writer.write_string(writer, 'username', obj.username) 3123 if obj.cluster is not None: 3124 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3125 if obj.cpu_profile is not None: 3126 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 3127 if obj.drivers_iso is not None: 3128 FileWriter.write_one(obj.drivers_iso, writer, 'drivers_iso') 3129 if obj.host is not None: 3130 HostWriter.write_one(obj.host, writer, 'host') 3131 if obj.quota is not None: 3132 QuotaWriter.write_one(obj.quota, writer, 'quota') 3133 if obj.storage_domain is not None: 3134 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3135 if obj.vm is not None: 3136 VmWriter.write_one(obj.vm, writer, 'vm') 3137 writer.write_end()
3139 @staticmethod 3140 def write_many(objs, writer, singular=None, plural=None): 3141 if singular is None: 3142 singular = 'external_vm_import' 3143 if plural is None: 3144 plural = 'external_vm_imports' 3145 writer.write_start(plural) 3146 if isinstance(objs, List): 3147 href = objs.href 3148 if href is not None: 3149 writer.write_attribute('href', href) 3150 for obj in objs: 3151 ExternalVmImportWriter.write_one(obj, writer, singular) 3152 writer.write_end()
3155class FaultWriter(Writer): 3156 3157 def __init__(self): 3158 super(FaultWriter, self).__init__() 3159 3160 @staticmethod 3161 def write_one(obj, writer, singular=None): 3162 if singular is None: 3163 singular = 'fault' 3164 writer.write_start(singular) 3165 href = obj.href 3166 if href is not None: 3167 writer.write_attribute('href', href) 3168 if obj.detail is not None: 3169 Writer.write_string(writer, 'detail', obj.detail) 3170 if obj.reason is not None: 3171 Writer.write_string(writer, 'reason', obj.reason) 3172 writer.write_end() 3173 3174 @staticmethod 3175 def write_many(objs, writer, singular=None, plural=None): 3176 if singular is None: 3177 singular = 'fault' 3178 if plural is None: 3179 plural = 'faults' 3180 writer.write_start(plural) 3181 if isinstance(objs, List): 3182 href = objs.href 3183 if href is not None: 3184 writer.write_attribute('href', href) 3185 for obj in objs: 3186 FaultWriter.write_one(obj, writer, singular) 3187 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3160 @staticmethod 3161 def write_one(obj, writer, singular=None): 3162 if singular is None: 3163 singular = 'fault' 3164 writer.write_start(singular) 3165 href = obj.href 3166 if href is not None: 3167 writer.write_attribute('href', href) 3168 if obj.detail is not None: 3169 Writer.write_string(writer, 'detail', obj.detail) 3170 if obj.reason is not None: 3171 Writer.write_string(writer, 'reason', obj.reason) 3172 writer.write_end()
3174 @staticmethod 3175 def write_many(objs, writer, singular=None, plural=None): 3176 if singular is None: 3177 singular = 'fault' 3178 if plural is None: 3179 plural = 'faults' 3180 writer.write_start(plural) 3181 if isinstance(objs, List): 3182 href = objs.href 3183 if href is not None: 3184 writer.write_attribute('href', href) 3185 for obj in objs: 3186 FaultWriter.write_one(obj, writer, singular) 3187 writer.write_end()
3190class FencingPolicyWriter(Writer): 3191 3192 def __init__(self): 3193 super(FencingPolicyWriter, self).__init__() 3194 3195 @staticmethod 3196 def write_one(obj, writer, singular=None): 3197 if singular is None: 3198 singular = 'fencing_policy' 3199 writer.write_start(singular) 3200 href = obj.href 3201 if href is not None: 3202 writer.write_attribute('href', href) 3203 if obj.enabled is not None: 3204 Writer.write_boolean(writer, 'enabled', obj.enabled) 3205 if obj.skip_if_connectivity_broken is not None: 3206 SkipIfConnectivityBrokenWriter.write_one(obj.skip_if_connectivity_broken, writer, 'skip_if_connectivity_broken') 3207 if obj.skip_if_gluster_bricks_up is not None: 3208 Writer.write_boolean(writer, 'skip_if_gluster_bricks_up', obj.skip_if_gluster_bricks_up) 3209 if obj.skip_if_gluster_quorum_not_met is not None: 3210 Writer.write_boolean(writer, 'skip_if_gluster_quorum_not_met', obj.skip_if_gluster_quorum_not_met) 3211 if obj.skip_if_sd_active is not None: 3212 SkipIfSdActiveWriter.write_one(obj.skip_if_sd_active, writer, 'skip_if_sd_active') 3213 writer.write_end() 3214 3215 @staticmethod 3216 def write_many(objs, writer, singular=None, plural=None): 3217 if singular is None: 3218 singular = 'fencing_policy' 3219 if plural is None: 3220 plural = 'fencing_policies' 3221 writer.write_start(plural) 3222 if isinstance(objs, List): 3223 href = objs.href 3224 if href is not None: 3225 writer.write_attribute('href', href) 3226 for obj in objs: 3227 FencingPolicyWriter.write_one(obj, writer, singular) 3228 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3195 @staticmethod 3196 def write_one(obj, writer, singular=None): 3197 if singular is None: 3198 singular = 'fencing_policy' 3199 writer.write_start(singular) 3200 href = obj.href 3201 if href is not None: 3202 writer.write_attribute('href', href) 3203 if obj.enabled is not None: 3204 Writer.write_boolean(writer, 'enabled', obj.enabled) 3205 if obj.skip_if_connectivity_broken is not None: 3206 SkipIfConnectivityBrokenWriter.write_one(obj.skip_if_connectivity_broken, writer, 'skip_if_connectivity_broken') 3207 if obj.skip_if_gluster_bricks_up is not None: 3208 Writer.write_boolean(writer, 'skip_if_gluster_bricks_up', obj.skip_if_gluster_bricks_up) 3209 if obj.skip_if_gluster_quorum_not_met is not None: 3210 Writer.write_boolean(writer, 'skip_if_gluster_quorum_not_met', obj.skip_if_gluster_quorum_not_met) 3211 if obj.skip_if_sd_active is not None: 3212 SkipIfSdActiveWriter.write_one(obj.skip_if_sd_active, writer, 'skip_if_sd_active') 3213 writer.write_end()
3215 @staticmethod 3216 def write_many(objs, writer, singular=None, plural=None): 3217 if singular is None: 3218 singular = 'fencing_policy' 3219 if plural is None: 3220 plural = 'fencing_policies' 3221 writer.write_start(plural) 3222 if isinstance(objs, List): 3223 href = objs.href 3224 if href is not None: 3225 writer.write_attribute('href', href) 3226 for obj in objs: 3227 FencingPolicyWriter.write_one(obj, writer, singular) 3228 writer.write_end()
3231class FileWriter(Writer): 3232 3233 def __init__(self): 3234 super(FileWriter, self).__init__() 3235 3236 @staticmethod 3237 def write_one(obj, writer, singular=None): 3238 if singular is None: 3239 singular = 'file' 3240 writer.write_start(singular) 3241 href = obj.href 3242 if href is not None: 3243 writer.write_attribute('href', href) 3244 if obj.id is not None: 3245 writer.write_attribute('id', obj.id) 3246 if obj.comment is not None: 3247 Writer.write_string(writer, 'comment', obj.comment) 3248 if obj.content is not None: 3249 Writer.write_string(writer, 'content', obj.content) 3250 if obj.description is not None: 3251 Writer.write_string(writer, 'description', obj.description) 3252 if obj.name is not None: 3253 Writer.write_string(writer, 'name', obj.name) 3254 if obj.type is not None: 3255 Writer.write_string(writer, 'type', obj.type) 3256 if obj.storage_domain is not None: 3257 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3258 writer.write_end() 3259 3260 @staticmethod 3261 def write_many(objs, writer, singular=None, plural=None): 3262 if singular is None: 3263 singular = 'file' 3264 if plural is None: 3265 plural = 'files' 3266 writer.write_start(plural) 3267 if isinstance(objs, List): 3268 href = objs.href 3269 if href is not None: 3270 writer.write_attribute('href', href) 3271 for obj in objs: 3272 FileWriter.write_one(obj, writer, singular) 3273 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3236 @staticmethod 3237 def write_one(obj, writer, singular=None): 3238 if singular is None: 3239 singular = 'file' 3240 writer.write_start(singular) 3241 href = obj.href 3242 if href is not None: 3243 writer.write_attribute('href', href) 3244 if obj.id is not None: 3245 writer.write_attribute('id', obj.id) 3246 if obj.comment is not None: 3247 Writer.write_string(writer, 'comment', obj.comment) 3248 if obj.content is not None: 3249 Writer.write_string(writer, 'content', obj.content) 3250 if obj.description is not None: 3251 Writer.write_string(writer, 'description', obj.description) 3252 if obj.name is not None: 3253 Writer.write_string(writer, 'name', obj.name) 3254 if obj.type is not None: 3255 Writer.write_string(writer, 'type', obj.type) 3256 if obj.storage_domain is not None: 3257 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 3258 writer.write_end()
3260 @staticmethod 3261 def write_many(objs, writer, singular=None, plural=None): 3262 if singular is None: 3263 singular = 'file' 3264 if plural is None: 3265 plural = 'files' 3266 writer.write_start(plural) 3267 if isinstance(objs, List): 3268 href = objs.href 3269 if href is not None: 3270 writer.write_attribute('href', href) 3271 for obj in objs: 3272 FileWriter.write_one(obj, writer, singular) 3273 writer.write_end()
3276class FilterWriter(Writer): 3277 3278 def __init__(self): 3279 super(FilterWriter, self).__init__() 3280 3281 @staticmethod 3282 def write_one(obj, writer, singular=None): 3283 if singular is None: 3284 singular = 'filter' 3285 writer.write_start(singular) 3286 href = obj.href 3287 if href is not None: 3288 writer.write_attribute('href', href) 3289 if obj.id is not None: 3290 writer.write_attribute('id', obj.id) 3291 if obj.comment is not None: 3292 Writer.write_string(writer, 'comment', obj.comment) 3293 if obj.description is not None: 3294 Writer.write_string(writer, 'description', obj.description) 3295 if obj.name is not None: 3296 Writer.write_string(writer, 'name', obj.name) 3297 if obj.position is not None: 3298 Writer.write_integer(writer, 'position', obj.position) 3299 if obj.scheduling_policy_unit is not None: 3300 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 3301 writer.write_end() 3302 3303 @staticmethod 3304 def write_many(objs, writer, singular=None, plural=None): 3305 if singular is None: 3306 singular = 'filter' 3307 if plural is None: 3308 plural = 'filters' 3309 writer.write_start(plural) 3310 if isinstance(objs, List): 3311 href = objs.href 3312 if href is not None: 3313 writer.write_attribute('href', href) 3314 for obj in objs: 3315 FilterWriter.write_one(obj, writer, singular) 3316 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3281 @staticmethod 3282 def write_one(obj, writer, singular=None): 3283 if singular is None: 3284 singular = 'filter' 3285 writer.write_start(singular) 3286 href = obj.href 3287 if href is not None: 3288 writer.write_attribute('href', href) 3289 if obj.id is not None: 3290 writer.write_attribute('id', obj.id) 3291 if obj.comment is not None: 3292 Writer.write_string(writer, 'comment', obj.comment) 3293 if obj.description is not None: 3294 Writer.write_string(writer, 'description', obj.description) 3295 if obj.name is not None: 3296 Writer.write_string(writer, 'name', obj.name) 3297 if obj.position is not None: 3298 Writer.write_integer(writer, 'position', obj.position) 3299 if obj.scheduling_policy_unit is not None: 3300 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 3301 writer.write_end()
3303 @staticmethod 3304 def write_many(objs, writer, singular=None, plural=None): 3305 if singular is None: 3306 singular = 'filter' 3307 if plural is None: 3308 plural = 'filters' 3309 writer.write_start(plural) 3310 if isinstance(objs, List): 3311 href = objs.href 3312 if href is not None: 3313 writer.write_attribute('href', href) 3314 for obj in objs: 3315 FilterWriter.write_one(obj, writer, singular) 3316 writer.write_end()
3319class FloppyWriter(Writer): 3320 3321 def __init__(self): 3322 super(FloppyWriter, self).__init__() 3323 3324 @staticmethod 3325 def write_one(obj, writer, singular=None): 3326 if singular is None: 3327 singular = 'floppy' 3328 writer.write_start(singular) 3329 href = obj.href 3330 if href is not None: 3331 writer.write_attribute('href', href) 3332 if obj.id is not None: 3333 writer.write_attribute('id', obj.id) 3334 if obj.comment is not None: 3335 Writer.write_string(writer, 'comment', obj.comment) 3336 if obj.description is not None: 3337 Writer.write_string(writer, 'description', obj.description) 3338 if obj.file is not None: 3339 FileWriter.write_one(obj.file, writer, 'file') 3340 if obj.name is not None: 3341 Writer.write_string(writer, 'name', obj.name) 3342 if obj.instance_type is not None: 3343 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3344 if obj.template is not None: 3345 TemplateWriter.write_one(obj.template, writer, 'template') 3346 if obj.vm is not None: 3347 VmWriter.write_one(obj.vm, writer, 'vm') 3348 if obj.vms is not None: 3349 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3350 writer.write_end() 3351 3352 @staticmethod 3353 def write_many(objs, writer, singular=None, plural=None): 3354 if singular is None: 3355 singular = 'floppy' 3356 if plural is None: 3357 plural = 'floppies' 3358 writer.write_start(plural) 3359 if isinstance(objs, List): 3360 href = objs.href 3361 if href is not None: 3362 writer.write_attribute('href', href) 3363 for obj in objs: 3364 FloppyWriter.write_one(obj, writer, singular) 3365 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3324 @staticmethod 3325 def write_one(obj, writer, singular=None): 3326 if singular is None: 3327 singular = 'floppy' 3328 writer.write_start(singular) 3329 href = obj.href 3330 if href is not None: 3331 writer.write_attribute('href', href) 3332 if obj.id is not None: 3333 writer.write_attribute('id', obj.id) 3334 if obj.comment is not None: 3335 Writer.write_string(writer, 'comment', obj.comment) 3336 if obj.description is not None: 3337 Writer.write_string(writer, 'description', obj.description) 3338 if obj.file is not None: 3339 FileWriter.write_one(obj.file, writer, 'file') 3340 if obj.name is not None: 3341 Writer.write_string(writer, 'name', obj.name) 3342 if obj.instance_type is not None: 3343 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3344 if obj.template is not None: 3345 TemplateWriter.write_one(obj.template, writer, 'template') 3346 if obj.vm is not None: 3347 VmWriter.write_one(obj.vm, writer, 'vm') 3348 if obj.vms is not None: 3349 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3350 writer.write_end()
3352 @staticmethod 3353 def write_many(objs, writer, singular=None, plural=None): 3354 if singular is None: 3355 singular = 'floppy' 3356 if plural is None: 3357 plural = 'floppies' 3358 writer.write_start(plural) 3359 if isinstance(objs, List): 3360 href = objs.href 3361 if href is not None: 3362 writer.write_attribute('href', href) 3363 for obj in objs: 3364 FloppyWriter.write_one(obj, writer, singular) 3365 writer.write_end()
3368class FopStatisticWriter(Writer): 3369 3370 def __init__(self): 3371 super(FopStatisticWriter, self).__init__() 3372 3373 @staticmethod 3374 def write_one(obj, writer, singular=None): 3375 if singular is None: 3376 singular = 'fop_statistic' 3377 writer.write_start(singular) 3378 href = obj.href 3379 if href is not None: 3380 writer.write_attribute('href', href) 3381 if obj.name is not None: 3382 Writer.write_string(writer, 'name', obj.name) 3383 if obj.statistics is not None: 3384 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3385 writer.write_end() 3386 3387 @staticmethod 3388 def write_many(objs, writer, singular=None, plural=None): 3389 if singular is None: 3390 singular = 'fop_statistic' 3391 if plural is None: 3392 plural = 'fop_statistics' 3393 writer.write_start(plural) 3394 if isinstance(objs, List): 3395 href = objs.href 3396 if href is not None: 3397 writer.write_attribute('href', href) 3398 for obj in objs: 3399 FopStatisticWriter.write_one(obj, writer, singular) 3400 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3373 @staticmethod 3374 def write_one(obj, writer, singular=None): 3375 if singular is None: 3376 singular = 'fop_statistic' 3377 writer.write_start(singular) 3378 href = obj.href 3379 if href is not None: 3380 writer.write_attribute('href', href) 3381 if obj.name is not None: 3382 Writer.write_string(writer, 'name', obj.name) 3383 if obj.statistics is not None: 3384 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3385 writer.write_end()
3387 @staticmethod 3388 def write_many(objs, writer, singular=None, plural=None): 3389 if singular is None: 3390 singular = 'fop_statistic' 3391 if plural is None: 3392 plural = 'fop_statistics' 3393 writer.write_start(plural) 3394 if isinstance(objs, List): 3395 href = objs.href 3396 if href is not None: 3397 writer.write_attribute('href', href) 3398 for obj in objs: 3399 FopStatisticWriter.write_one(obj, writer, singular) 3400 writer.write_end()
3403class GlusterBrickWriter(Writer): 3404 3405 def __init__(self): 3406 super(GlusterBrickWriter, self).__init__() 3407 3408 @staticmethod 3409 def write_one(obj, writer, singular=None): 3410 if singular is None: 3411 singular = 'brick' 3412 writer.write_start(singular) 3413 href = obj.href 3414 if href is not None: 3415 writer.write_attribute('href', href) 3416 if obj.id is not None: 3417 writer.write_attribute('id', obj.id) 3418 if obj.brick_dir is not None: 3419 Writer.write_string(writer, 'brick_dir', obj.brick_dir) 3420 if obj.comment is not None: 3421 Writer.write_string(writer, 'comment', obj.comment) 3422 if obj.description is not None: 3423 Writer.write_string(writer, 'description', obj.description) 3424 if obj.device is not None: 3425 Writer.write_string(writer, 'device', obj.device) 3426 if obj.fs_name is not None: 3427 Writer.write_string(writer, 'fs_name', obj.fs_name) 3428 if obj.gluster_clients is not None: 3429 GlusterClientWriter.write_many(obj.gluster_clients, writer, 'gluster_client', 'gluster_clients') 3430 if obj.memory_pools is not None: 3431 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3432 if obj.mnt_options is not None: 3433 Writer.write_string(writer, 'mnt_options', obj.mnt_options) 3434 if obj.name is not None: 3435 Writer.write_string(writer, 'name', obj.name) 3436 if obj.pid is not None: 3437 Writer.write_integer(writer, 'pid', obj.pid) 3438 if obj.port is not None: 3439 Writer.write_integer(writer, 'port', obj.port) 3440 if obj.server_id is not None: 3441 Writer.write_string(writer, 'server_id', obj.server_id) 3442 if obj.status is not None: 3443 Writer.write_string(writer, 'status', obj.status.value) 3444 if obj.gluster_volume is not None: 3445 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 3446 if obj.instance_type is not None: 3447 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3448 if obj.statistics is not None: 3449 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3450 if obj.template is not None: 3451 TemplateWriter.write_one(obj.template, writer, 'template') 3452 if obj.vm is not None: 3453 VmWriter.write_one(obj.vm, writer, 'vm') 3454 if obj.vms is not None: 3455 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3456 writer.write_end() 3457 3458 @staticmethod 3459 def write_many(objs, writer, singular=None, plural=None): 3460 if singular is None: 3461 singular = 'brick' 3462 if plural is None: 3463 plural = 'bricks' 3464 writer.write_start(plural) 3465 if isinstance(objs, List): 3466 href = objs.href 3467 if href is not None: 3468 writer.write_attribute('href', href) 3469 for obj in objs: 3470 GlusterBrickWriter.write_one(obj, writer, singular) 3471 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3408 @staticmethod 3409 def write_one(obj, writer, singular=None): 3410 if singular is None: 3411 singular = 'brick' 3412 writer.write_start(singular) 3413 href = obj.href 3414 if href is not None: 3415 writer.write_attribute('href', href) 3416 if obj.id is not None: 3417 writer.write_attribute('id', obj.id) 3418 if obj.brick_dir is not None: 3419 Writer.write_string(writer, 'brick_dir', obj.brick_dir) 3420 if obj.comment is not None: 3421 Writer.write_string(writer, 'comment', obj.comment) 3422 if obj.description is not None: 3423 Writer.write_string(writer, 'description', obj.description) 3424 if obj.device is not None: 3425 Writer.write_string(writer, 'device', obj.device) 3426 if obj.fs_name is not None: 3427 Writer.write_string(writer, 'fs_name', obj.fs_name) 3428 if obj.gluster_clients is not None: 3429 GlusterClientWriter.write_many(obj.gluster_clients, writer, 'gluster_client', 'gluster_clients') 3430 if obj.memory_pools is not None: 3431 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3432 if obj.mnt_options is not None: 3433 Writer.write_string(writer, 'mnt_options', obj.mnt_options) 3434 if obj.name is not None: 3435 Writer.write_string(writer, 'name', obj.name) 3436 if obj.pid is not None: 3437 Writer.write_integer(writer, 'pid', obj.pid) 3438 if obj.port is not None: 3439 Writer.write_integer(writer, 'port', obj.port) 3440 if obj.server_id is not None: 3441 Writer.write_string(writer, 'server_id', obj.server_id) 3442 if obj.status is not None: 3443 Writer.write_string(writer, 'status', obj.status.value) 3444 if obj.gluster_volume is not None: 3445 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 3446 if obj.instance_type is not None: 3447 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3448 if obj.statistics is not None: 3449 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3450 if obj.template is not None: 3451 TemplateWriter.write_one(obj.template, writer, 'template') 3452 if obj.vm is not None: 3453 VmWriter.write_one(obj.vm, writer, 'vm') 3454 if obj.vms is not None: 3455 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3456 writer.write_end()
3458 @staticmethod 3459 def write_many(objs, writer, singular=None, plural=None): 3460 if singular is None: 3461 singular = 'brick' 3462 if plural is None: 3463 plural = 'bricks' 3464 writer.write_start(plural) 3465 if isinstance(objs, List): 3466 href = objs.href 3467 if href is not None: 3468 writer.write_attribute('href', href) 3469 for obj in objs: 3470 GlusterBrickWriter.write_one(obj, writer, singular) 3471 writer.write_end()
3474class GlusterBrickAdvancedDetailsWriter(Writer): 3475 3476 def __init__(self): 3477 super(GlusterBrickAdvancedDetailsWriter, self).__init__() 3478 3479 @staticmethod 3480 def write_one(obj, writer, singular=None): 3481 if singular is None: 3482 singular = 'gluster_brick_advanced_details' 3483 writer.write_start(singular) 3484 href = obj.href 3485 if href is not None: 3486 writer.write_attribute('href', href) 3487 if obj.id is not None: 3488 writer.write_attribute('id', obj.id) 3489 if obj.comment is not None: 3490 Writer.write_string(writer, 'comment', obj.comment) 3491 if obj.description is not None: 3492 Writer.write_string(writer, 'description', obj.description) 3493 if obj.device is not None: 3494 Writer.write_string(writer, 'device', obj.device) 3495 if obj.fs_name is not None: 3496 Writer.write_string(writer, 'fs_name', obj.fs_name) 3497 if obj.gluster_clients is not None: 3498 GlusterClientWriter.write_many(obj.gluster_clients, writer, 'gluster_client', 'gluster_clients') 3499 if obj.memory_pools is not None: 3500 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3501 if obj.mnt_options is not None: 3502 Writer.write_string(writer, 'mnt_options', obj.mnt_options) 3503 if obj.name is not None: 3504 Writer.write_string(writer, 'name', obj.name) 3505 if obj.pid is not None: 3506 Writer.write_integer(writer, 'pid', obj.pid) 3507 if obj.port is not None: 3508 Writer.write_integer(writer, 'port', obj.port) 3509 if obj.instance_type is not None: 3510 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3511 if obj.template is not None: 3512 TemplateWriter.write_one(obj.template, writer, 'template') 3513 if obj.vm is not None: 3514 VmWriter.write_one(obj.vm, writer, 'vm') 3515 if obj.vms is not None: 3516 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3517 writer.write_end() 3518 3519 @staticmethod 3520 def write_many(objs, writer, singular=None, plural=None): 3521 if singular is None: 3522 singular = 'gluster_brick_advanced_details' 3523 if plural is None: 3524 plural = 'gluster_brick_advanced_detailss' 3525 writer.write_start(plural) 3526 if isinstance(objs, List): 3527 href = objs.href 3528 if href is not None: 3529 writer.write_attribute('href', href) 3530 for obj in objs: 3531 GlusterBrickAdvancedDetailsWriter.write_one(obj, writer, singular) 3532 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3479 @staticmethod 3480 def write_one(obj, writer, singular=None): 3481 if singular is None: 3482 singular = 'gluster_brick_advanced_details' 3483 writer.write_start(singular) 3484 href = obj.href 3485 if href is not None: 3486 writer.write_attribute('href', href) 3487 if obj.id is not None: 3488 writer.write_attribute('id', obj.id) 3489 if obj.comment is not None: 3490 Writer.write_string(writer, 'comment', obj.comment) 3491 if obj.description is not None: 3492 Writer.write_string(writer, 'description', obj.description) 3493 if obj.device is not None: 3494 Writer.write_string(writer, 'device', obj.device) 3495 if obj.fs_name is not None: 3496 Writer.write_string(writer, 'fs_name', obj.fs_name) 3497 if obj.gluster_clients is not None: 3498 GlusterClientWriter.write_many(obj.gluster_clients, writer, 'gluster_client', 'gluster_clients') 3499 if obj.memory_pools is not None: 3500 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3501 if obj.mnt_options is not None: 3502 Writer.write_string(writer, 'mnt_options', obj.mnt_options) 3503 if obj.name is not None: 3504 Writer.write_string(writer, 'name', obj.name) 3505 if obj.pid is not None: 3506 Writer.write_integer(writer, 'pid', obj.pid) 3507 if obj.port is not None: 3508 Writer.write_integer(writer, 'port', obj.port) 3509 if obj.instance_type is not None: 3510 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3511 if obj.template is not None: 3512 TemplateWriter.write_one(obj.template, writer, 'template') 3513 if obj.vm is not None: 3514 VmWriter.write_one(obj.vm, writer, 'vm') 3515 if obj.vms is not None: 3516 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 3517 writer.write_end()
3519 @staticmethod 3520 def write_many(objs, writer, singular=None, plural=None): 3521 if singular is None: 3522 singular = 'gluster_brick_advanced_details' 3523 if plural is None: 3524 plural = 'gluster_brick_advanced_detailss' 3525 writer.write_start(plural) 3526 if isinstance(objs, List): 3527 href = objs.href 3528 if href is not None: 3529 writer.write_attribute('href', href) 3530 for obj in objs: 3531 GlusterBrickAdvancedDetailsWriter.write_one(obj, writer, singular) 3532 writer.write_end()
3535class GlusterBrickMemoryInfoWriter(Writer): 3536 3537 def __init__(self): 3538 super(GlusterBrickMemoryInfoWriter, self).__init__() 3539 3540 @staticmethod 3541 def write_one(obj, writer, singular=None): 3542 if singular is None: 3543 singular = 'brick_memoryinfo' 3544 writer.write_start(singular) 3545 href = obj.href 3546 if href is not None: 3547 writer.write_attribute('href', href) 3548 if obj.memory_pools is not None: 3549 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3550 writer.write_end() 3551 3552 @staticmethod 3553 def write_many(objs, writer, singular=None, plural=None): 3554 if singular is None: 3555 singular = 'brick_memoryinfo' 3556 if plural is None: 3557 plural = 'gluster_brick_memory_infos' 3558 writer.write_start(plural) 3559 if isinstance(objs, List): 3560 href = objs.href 3561 if href is not None: 3562 writer.write_attribute('href', href) 3563 for obj in objs: 3564 GlusterBrickMemoryInfoWriter.write_one(obj, writer, singular) 3565 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3540 @staticmethod 3541 def write_one(obj, writer, singular=None): 3542 if singular is None: 3543 singular = 'brick_memoryinfo' 3544 writer.write_start(singular) 3545 href = obj.href 3546 if href is not None: 3547 writer.write_attribute('href', href) 3548 if obj.memory_pools is not None: 3549 GlusterMemoryPoolWriter.write_many(obj.memory_pools, writer, 'memory_pool', 'memory_pools') 3550 writer.write_end()
3552 @staticmethod 3553 def write_many(objs, writer, singular=None, plural=None): 3554 if singular is None: 3555 singular = 'brick_memoryinfo' 3556 if plural is None: 3557 plural = 'gluster_brick_memory_infos' 3558 writer.write_start(plural) 3559 if isinstance(objs, List): 3560 href = objs.href 3561 if href is not None: 3562 writer.write_attribute('href', href) 3563 for obj in objs: 3564 GlusterBrickMemoryInfoWriter.write_one(obj, writer, singular) 3565 writer.write_end()
3568class GlusterClientWriter(Writer): 3569 3570 def __init__(self): 3571 super(GlusterClientWriter, self).__init__() 3572 3573 @staticmethod 3574 def write_one(obj, writer, singular=None): 3575 if singular is None: 3576 singular = 'gluster_client' 3577 writer.write_start(singular) 3578 href = obj.href 3579 if href is not None: 3580 writer.write_attribute('href', href) 3581 if obj.bytes_read is not None: 3582 Writer.write_integer(writer, 'bytes_read', obj.bytes_read) 3583 if obj.bytes_written is not None: 3584 Writer.write_integer(writer, 'bytes_written', obj.bytes_written) 3585 if obj.client_port is not None: 3586 Writer.write_integer(writer, 'client_port', obj.client_port) 3587 if obj.host_name is not None: 3588 Writer.write_string(writer, 'host_name', obj.host_name) 3589 writer.write_end() 3590 3591 @staticmethod 3592 def write_many(objs, writer, singular=None, plural=None): 3593 if singular is None: 3594 singular = 'gluster_client' 3595 if plural is None: 3596 plural = 'gluster_clients' 3597 writer.write_start(plural) 3598 if isinstance(objs, List): 3599 href = objs.href 3600 if href is not None: 3601 writer.write_attribute('href', href) 3602 for obj in objs: 3603 GlusterClientWriter.write_one(obj, writer, singular) 3604 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3573 @staticmethod 3574 def write_one(obj, writer, singular=None): 3575 if singular is None: 3576 singular = 'gluster_client' 3577 writer.write_start(singular) 3578 href = obj.href 3579 if href is not None: 3580 writer.write_attribute('href', href) 3581 if obj.bytes_read is not None: 3582 Writer.write_integer(writer, 'bytes_read', obj.bytes_read) 3583 if obj.bytes_written is not None: 3584 Writer.write_integer(writer, 'bytes_written', obj.bytes_written) 3585 if obj.client_port is not None: 3586 Writer.write_integer(writer, 'client_port', obj.client_port) 3587 if obj.host_name is not None: 3588 Writer.write_string(writer, 'host_name', obj.host_name) 3589 writer.write_end()
3591 @staticmethod 3592 def write_many(objs, writer, singular=None, plural=None): 3593 if singular is None: 3594 singular = 'gluster_client' 3595 if plural is None: 3596 plural = 'gluster_clients' 3597 writer.write_start(plural) 3598 if isinstance(objs, List): 3599 href = objs.href 3600 if href is not None: 3601 writer.write_attribute('href', href) 3602 for obj in objs: 3603 GlusterClientWriter.write_one(obj, writer, singular) 3604 writer.write_end()
3607class GlusterHookWriter(Writer): 3608 3609 def __init__(self): 3610 super(GlusterHookWriter, self).__init__() 3611 3612 @staticmethod 3613 def write_one(obj, writer, singular=None): 3614 if singular is None: 3615 singular = 'gluster_hook' 3616 writer.write_start(singular) 3617 href = obj.href 3618 if href is not None: 3619 writer.write_attribute('href', href) 3620 if obj.id is not None: 3621 writer.write_attribute('id', obj.id) 3622 if obj.checksum is not None: 3623 Writer.write_string(writer, 'checksum', obj.checksum) 3624 if obj.comment is not None: 3625 Writer.write_string(writer, 'comment', obj.comment) 3626 if obj.conflict_status is not None: 3627 Writer.write_integer(writer, 'conflict_status', obj.conflict_status) 3628 if obj.conflicts is not None: 3629 Writer.write_string(writer, 'conflicts', obj.conflicts) 3630 if obj.content is not None: 3631 Writer.write_string(writer, 'content', obj.content) 3632 if obj.content_type is not None: 3633 Writer.write_string(writer, 'content_type', obj.content_type.value) 3634 if obj.description is not None: 3635 Writer.write_string(writer, 'description', obj.description) 3636 if obj.gluster_command is not None: 3637 Writer.write_string(writer, 'gluster_command', obj.gluster_command) 3638 if obj.name is not None: 3639 Writer.write_string(writer, 'name', obj.name) 3640 if obj.stage is not None: 3641 Writer.write_string(writer, 'stage', obj.stage.value) 3642 if obj.status is not None: 3643 Writer.write_string(writer, 'status', obj.status.value) 3644 if obj.cluster is not None: 3645 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3646 if obj.server_hooks is not None: 3647 GlusterServerHookWriter.write_many(obj.server_hooks, writer, 'server_hook', 'server_hooks') 3648 writer.write_end() 3649 3650 @staticmethod 3651 def write_many(objs, writer, singular=None, plural=None): 3652 if singular is None: 3653 singular = 'gluster_hook' 3654 if plural is None: 3655 plural = 'gluster_hooks' 3656 writer.write_start(plural) 3657 if isinstance(objs, List): 3658 href = objs.href 3659 if href is not None: 3660 writer.write_attribute('href', href) 3661 for obj in objs: 3662 GlusterHookWriter.write_one(obj, writer, singular) 3663 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3612 @staticmethod 3613 def write_one(obj, writer, singular=None): 3614 if singular is None: 3615 singular = 'gluster_hook' 3616 writer.write_start(singular) 3617 href = obj.href 3618 if href is not None: 3619 writer.write_attribute('href', href) 3620 if obj.id is not None: 3621 writer.write_attribute('id', obj.id) 3622 if obj.checksum is not None: 3623 Writer.write_string(writer, 'checksum', obj.checksum) 3624 if obj.comment is not None: 3625 Writer.write_string(writer, 'comment', obj.comment) 3626 if obj.conflict_status is not None: 3627 Writer.write_integer(writer, 'conflict_status', obj.conflict_status) 3628 if obj.conflicts is not None: 3629 Writer.write_string(writer, 'conflicts', obj.conflicts) 3630 if obj.content is not None: 3631 Writer.write_string(writer, 'content', obj.content) 3632 if obj.content_type is not None: 3633 Writer.write_string(writer, 'content_type', obj.content_type.value) 3634 if obj.description is not None: 3635 Writer.write_string(writer, 'description', obj.description) 3636 if obj.gluster_command is not None: 3637 Writer.write_string(writer, 'gluster_command', obj.gluster_command) 3638 if obj.name is not None: 3639 Writer.write_string(writer, 'name', obj.name) 3640 if obj.stage is not None: 3641 Writer.write_string(writer, 'stage', obj.stage.value) 3642 if obj.status is not None: 3643 Writer.write_string(writer, 'status', obj.status.value) 3644 if obj.cluster is not None: 3645 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3646 if obj.server_hooks is not None: 3647 GlusterServerHookWriter.write_many(obj.server_hooks, writer, 'server_hook', 'server_hooks') 3648 writer.write_end()
3650 @staticmethod 3651 def write_many(objs, writer, singular=None, plural=None): 3652 if singular is None: 3653 singular = 'gluster_hook' 3654 if plural is None: 3655 plural = 'gluster_hooks' 3656 writer.write_start(plural) 3657 if isinstance(objs, List): 3658 href = objs.href 3659 if href is not None: 3660 writer.write_attribute('href', href) 3661 for obj in objs: 3662 GlusterHookWriter.write_one(obj, writer, singular) 3663 writer.write_end()
3666class GlusterMemoryPoolWriter(Writer): 3667 3668 def __init__(self): 3669 super(GlusterMemoryPoolWriter, self).__init__() 3670 3671 @staticmethod 3672 def write_one(obj, writer, singular=None): 3673 if singular is None: 3674 singular = 'memory_pool' 3675 writer.write_start(singular) 3676 href = obj.href 3677 if href is not None: 3678 writer.write_attribute('href', href) 3679 if obj.id is not None: 3680 writer.write_attribute('id', obj.id) 3681 if obj.alloc_count is not None: 3682 Writer.write_integer(writer, 'alloc_count', obj.alloc_count) 3683 if obj.cold_count is not None: 3684 Writer.write_integer(writer, 'cold_count', obj.cold_count) 3685 if obj.comment is not None: 3686 Writer.write_string(writer, 'comment', obj.comment) 3687 if obj.description is not None: 3688 Writer.write_string(writer, 'description', obj.description) 3689 if obj.hot_count is not None: 3690 Writer.write_integer(writer, 'hot_count', obj.hot_count) 3691 if obj.max_alloc is not None: 3692 Writer.write_integer(writer, 'max_alloc', obj.max_alloc) 3693 if obj.max_stdalloc is not None: 3694 Writer.write_integer(writer, 'max_stdalloc', obj.max_stdalloc) 3695 if obj.name is not None: 3696 Writer.write_string(writer, 'name', obj.name) 3697 if obj.padded_size is not None: 3698 Writer.write_integer(writer, 'padded_size', obj.padded_size) 3699 if obj.pool_misses is not None: 3700 Writer.write_integer(writer, 'pool_misses', obj.pool_misses) 3701 if obj.type is not None: 3702 Writer.write_string(writer, 'type', obj.type) 3703 writer.write_end() 3704 3705 @staticmethod 3706 def write_many(objs, writer, singular=None, plural=None): 3707 if singular is None: 3708 singular = 'memory_pool' 3709 if plural is None: 3710 plural = 'memory_pools' 3711 writer.write_start(plural) 3712 if isinstance(objs, List): 3713 href = objs.href 3714 if href is not None: 3715 writer.write_attribute('href', href) 3716 for obj in objs: 3717 GlusterMemoryPoolWriter.write_one(obj, writer, singular) 3718 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3671 @staticmethod 3672 def write_one(obj, writer, singular=None): 3673 if singular is None: 3674 singular = 'memory_pool' 3675 writer.write_start(singular) 3676 href = obj.href 3677 if href is not None: 3678 writer.write_attribute('href', href) 3679 if obj.id is not None: 3680 writer.write_attribute('id', obj.id) 3681 if obj.alloc_count is not None: 3682 Writer.write_integer(writer, 'alloc_count', obj.alloc_count) 3683 if obj.cold_count is not None: 3684 Writer.write_integer(writer, 'cold_count', obj.cold_count) 3685 if obj.comment is not None: 3686 Writer.write_string(writer, 'comment', obj.comment) 3687 if obj.description is not None: 3688 Writer.write_string(writer, 'description', obj.description) 3689 if obj.hot_count is not None: 3690 Writer.write_integer(writer, 'hot_count', obj.hot_count) 3691 if obj.max_alloc is not None: 3692 Writer.write_integer(writer, 'max_alloc', obj.max_alloc) 3693 if obj.max_stdalloc is not None: 3694 Writer.write_integer(writer, 'max_stdalloc', obj.max_stdalloc) 3695 if obj.name is not None: 3696 Writer.write_string(writer, 'name', obj.name) 3697 if obj.padded_size is not None: 3698 Writer.write_integer(writer, 'padded_size', obj.padded_size) 3699 if obj.pool_misses is not None: 3700 Writer.write_integer(writer, 'pool_misses', obj.pool_misses) 3701 if obj.type is not None: 3702 Writer.write_string(writer, 'type', obj.type) 3703 writer.write_end()
3705 @staticmethod 3706 def write_many(objs, writer, singular=None, plural=None): 3707 if singular is None: 3708 singular = 'memory_pool' 3709 if plural is None: 3710 plural = 'memory_pools' 3711 writer.write_start(plural) 3712 if isinstance(objs, List): 3713 href = objs.href 3714 if href is not None: 3715 writer.write_attribute('href', href) 3716 for obj in objs: 3717 GlusterMemoryPoolWriter.write_one(obj, writer, singular) 3718 writer.write_end()
3721class GlusterServerHookWriter(Writer): 3722 3723 def __init__(self): 3724 super(GlusterServerHookWriter, self).__init__() 3725 3726 @staticmethod 3727 def write_one(obj, writer, singular=None): 3728 if singular is None: 3729 singular = 'server_hook' 3730 writer.write_start(singular) 3731 href = obj.href 3732 if href is not None: 3733 writer.write_attribute('href', href) 3734 if obj.id is not None: 3735 writer.write_attribute('id', obj.id) 3736 if obj.checksum is not None: 3737 Writer.write_string(writer, 'checksum', obj.checksum) 3738 if obj.comment is not None: 3739 Writer.write_string(writer, 'comment', obj.comment) 3740 if obj.content_type is not None: 3741 Writer.write_string(writer, 'content_type', obj.content_type.value) 3742 if obj.description is not None: 3743 Writer.write_string(writer, 'description', obj.description) 3744 if obj.name is not None: 3745 Writer.write_string(writer, 'name', obj.name) 3746 if obj.status is not None: 3747 Writer.write_string(writer, 'status', obj.status.value) 3748 if obj.host is not None: 3749 HostWriter.write_one(obj.host, writer, 'host') 3750 writer.write_end() 3751 3752 @staticmethod 3753 def write_many(objs, writer, singular=None, plural=None): 3754 if singular is None: 3755 singular = 'server_hook' 3756 if plural is None: 3757 plural = 'server_hooks' 3758 writer.write_start(plural) 3759 if isinstance(objs, List): 3760 href = objs.href 3761 if href is not None: 3762 writer.write_attribute('href', href) 3763 for obj in objs: 3764 GlusterServerHookWriter.write_one(obj, writer, singular) 3765 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3726 @staticmethod 3727 def write_one(obj, writer, singular=None): 3728 if singular is None: 3729 singular = 'server_hook' 3730 writer.write_start(singular) 3731 href = obj.href 3732 if href is not None: 3733 writer.write_attribute('href', href) 3734 if obj.id is not None: 3735 writer.write_attribute('id', obj.id) 3736 if obj.checksum is not None: 3737 Writer.write_string(writer, 'checksum', obj.checksum) 3738 if obj.comment is not None: 3739 Writer.write_string(writer, 'comment', obj.comment) 3740 if obj.content_type is not None: 3741 Writer.write_string(writer, 'content_type', obj.content_type.value) 3742 if obj.description is not None: 3743 Writer.write_string(writer, 'description', obj.description) 3744 if obj.name is not None: 3745 Writer.write_string(writer, 'name', obj.name) 3746 if obj.status is not None: 3747 Writer.write_string(writer, 'status', obj.status.value) 3748 if obj.host is not None: 3749 HostWriter.write_one(obj.host, writer, 'host') 3750 writer.write_end()
3752 @staticmethod 3753 def write_many(objs, writer, singular=None, plural=None): 3754 if singular is None: 3755 singular = 'server_hook' 3756 if plural is None: 3757 plural = 'server_hooks' 3758 writer.write_start(plural) 3759 if isinstance(objs, List): 3760 href = objs.href 3761 if href is not None: 3762 writer.write_attribute('href', href) 3763 for obj in objs: 3764 GlusterServerHookWriter.write_one(obj, writer, singular) 3765 writer.write_end()
3768class GlusterVolumeWriter(Writer): 3769 3770 def __init__(self): 3771 super(GlusterVolumeWriter, self).__init__() 3772 3773 @staticmethod 3774 def write_one(obj, writer, singular=None): 3775 if singular is None: 3776 singular = 'gluster_volume' 3777 writer.write_start(singular) 3778 href = obj.href 3779 if href is not None: 3780 writer.write_attribute('href', href) 3781 if obj.id is not None: 3782 writer.write_attribute('id', obj.id) 3783 if obj.comment is not None: 3784 Writer.write_string(writer, 'comment', obj.comment) 3785 if obj.description is not None: 3786 Writer.write_string(writer, 'description', obj.description) 3787 if obj.disperse_count is not None: 3788 Writer.write_integer(writer, 'disperse_count', obj.disperse_count) 3789 if obj.name is not None: 3790 Writer.write_string(writer, 'name', obj.name) 3791 if obj.options is not None: 3792 OptionWriter.write_many(obj.options, writer, 'option', 'options') 3793 if obj.redundancy_count is not None: 3794 Writer.write_integer(writer, 'redundancy_count', obj.redundancy_count) 3795 if obj.replica_count is not None: 3796 Writer.write_integer(writer, 'replica_count', obj.replica_count) 3797 if obj.status is not None: 3798 Writer.write_string(writer, 'status', obj.status.value) 3799 if obj.stripe_count is not None: 3800 Writer.write_integer(writer, 'stripe_count', obj.stripe_count) 3801 if obj.transport_types is not None: 3802 writer.write_start('transport_types') 3803 for item in obj.transport_types: 3804 if item is not None: 3805 Writer.write_string(writer, 'transport_type', item.value) 3806 writer.write_end() 3807 if obj.volume_type is not None: 3808 Writer.write_string(writer, 'volume_type', obj.volume_type.value) 3809 if obj.bricks is not None: 3810 GlusterBrickWriter.write_many(obj.bricks, writer, 'brick', 'bricks') 3811 if obj.cluster is not None: 3812 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3813 if obj.statistics is not None: 3814 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3815 writer.write_end() 3816 3817 @staticmethod 3818 def write_many(objs, writer, singular=None, plural=None): 3819 if singular is None: 3820 singular = 'gluster_volume' 3821 if plural is None: 3822 plural = 'gluster_volumes' 3823 writer.write_start(plural) 3824 if isinstance(objs, List): 3825 href = objs.href 3826 if href is not None: 3827 writer.write_attribute('href', href) 3828 for obj in objs: 3829 GlusterVolumeWriter.write_one(obj, writer, singular) 3830 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3773 @staticmethod 3774 def write_one(obj, writer, singular=None): 3775 if singular is None: 3776 singular = 'gluster_volume' 3777 writer.write_start(singular) 3778 href = obj.href 3779 if href is not None: 3780 writer.write_attribute('href', href) 3781 if obj.id is not None: 3782 writer.write_attribute('id', obj.id) 3783 if obj.comment is not None: 3784 Writer.write_string(writer, 'comment', obj.comment) 3785 if obj.description is not None: 3786 Writer.write_string(writer, 'description', obj.description) 3787 if obj.disperse_count is not None: 3788 Writer.write_integer(writer, 'disperse_count', obj.disperse_count) 3789 if obj.name is not None: 3790 Writer.write_string(writer, 'name', obj.name) 3791 if obj.options is not None: 3792 OptionWriter.write_many(obj.options, writer, 'option', 'options') 3793 if obj.redundancy_count is not None: 3794 Writer.write_integer(writer, 'redundancy_count', obj.redundancy_count) 3795 if obj.replica_count is not None: 3796 Writer.write_integer(writer, 'replica_count', obj.replica_count) 3797 if obj.status is not None: 3798 Writer.write_string(writer, 'status', obj.status.value) 3799 if obj.stripe_count is not None: 3800 Writer.write_integer(writer, 'stripe_count', obj.stripe_count) 3801 if obj.transport_types is not None: 3802 writer.write_start('transport_types') 3803 for item in obj.transport_types: 3804 if item is not None: 3805 Writer.write_string(writer, 'transport_type', item.value) 3806 writer.write_end() 3807 if obj.volume_type is not None: 3808 Writer.write_string(writer, 'volume_type', obj.volume_type.value) 3809 if obj.bricks is not None: 3810 GlusterBrickWriter.write_many(obj.bricks, writer, 'brick', 'bricks') 3811 if obj.cluster is not None: 3812 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 3813 if obj.statistics is not None: 3814 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 3815 writer.write_end()
3817 @staticmethod 3818 def write_many(objs, writer, singular=None, plural=None): 3819 if singular is None: 3820 singular = 'gluster_volume' 3821 if plural is None: 3822 plural = 'gluster_volumes' 3823 writer.write_start(plural) 3824 if isinstance(objs, List): 3825 href = objs.href 3826 if href is not None: 3827 writer.write_attribute('href', href) 3828 for obj in objs: 3829 GlusterVolumeWriter.write_one(obj, writer, singular) 3830 writer.write_end()
3833class GlusterVolumeProfileDetailsWriter(Writer): 3834 3835 def __init__(self): 3836 super(GlusterVolumeProfileDetailsWriter, self).__init__() 3837 3838 @staticmethod 3839 def write_one(obj, writer, singular=None): 3840 if singular is None: 3841 singular = 'gluster_volume_profile_details' 3842 writer.write_start(singular) 3843 href = obj.href 3844 if href is not None: 3845 writer.write_attribute('href', href) 3846 if obj.id is not None: 3847 writer.write_attribute('id', obj.id) 3848 if obj.brick_profile_details is not None: 3849 BrickProfileDetailWriter.write_many(obj.brick_profile_details, writer, 'brick_profile_detail', 'brick_profile_details') 3850 if obj.comment is not None: 3851 Writer.write_string(writer, 'comment', obj.comment) 3852 if obj.description is not None: 3853 Writer.write_string(writer, 'description', obj.description) 3854 if obj.name is not None: 3855 Writer.write_string(writer, 'name', obj.name) 3856 if obj.nfs_profile_details is not None: 3857 NfsProfileDetailWriter.write_many(obj.nfs_profile_details, writer, 'nfs_profile_detail', 'nfs_profile_details') 3858 writer.write_end() 3859 3860 @staticmethod 3861 def write_many(objs, writer, singular=None, plural=None): 3862 if singular is None: 3863 singular = 'gluster_volume_profile_details' 3864 if plural is None: 3865 plural = 'gluster_volume_profile_detailss' 3866 writer.write_start(plural) 3867 if isinstance(objs, List): 3868 href = objs.href 3869 if href is not None: 3870 writer.write_attribute('href', href) 3871 for obj in objs: 3872 GlusterVolumeProfileDetailsWriter.write_one(obj, writer, singular) 3873 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3838 @staticmethod 3839 def write_one(obj, writer, singular=None): 3840 if singular is None: 3841 singular = 'gluster_volume_profile_details' 3842 writer.write_start(singular) 3843 href = obj.href 3844 if href is not None: 3845 writer.write_attribute('href', href) 3846 if obj.id is not None: 3847 writer.write_attribute('id', obj.id) 3848 if obj.brick_profile_details is not None: 3849 BrickProfileDetailWriter.write_many(obj.brick_profile_details, writer, 'brick_profile_detail', 'brick_profile_details') 3850 if obj.comment is not None: 3851 Writer.write_string(writer, 'comment', obj.comment) 3852 if obj.description is not None: 3853 Writer.write_string(writer, 'description', obj.description) 3854 if obj.name is not None: 3855 Writer.write_string(writer, 'name', obj.name) 3856 if obj.nfs_profile_details is not None: 3857 NfsProfileDetailWriter.write_many(obj.nfs_profile_details, writer, 'nfs_profile_detail', 'nfs_profile_details') 3858 writer.write_end()
3860 @staticmethod 3861 def write_many(objs, writer, singular=None, plural=None): 3862 if singular is None: 3863 singular = 'gluster_volume_profile_details' 3864 if plural is None: 3865 plural = 'gluster_volume_profile_detailss' 3866 writer.write_start(plural) 3867 if isinstance(objs, List): 3868 href = objs.href 3869 if href is not None: 3870 writer.write_attribute('href', href) 3871 for obj in objs: 3872 GlusterVolumeProfileDetailsWriter.write_one(obj, writer, singular) 3873 writer.write_end()
3876class GracePeriodWriter(Writer): 3877 3878 def __init__(self): 3879 super(GracePeriodWriter, self).__init__() 3880 3881 @staticmethod 3882 def write_one(obj, writer, singular=None): 3883 if singular is None: 3884 singular = 'grace_period' 3885 writer.write_start(singular) 3886 href = obj.href 3887 if href is not None: 3888 writer.write_attribute('href', href) 3889 if obj.expiry is not None: 3890 Writer.write_integer(writer, 'expiry', obj.expiry) 3891 writer.write_end() 3892 3893 @staticmethod 3894 def write_many(objs, writer, singular=None, plural=None): 3895 if singular is None: 3896 singular = 'grace_period' 3897 if plural is None: 3898 plural = 'grace_periods' 3899 writer.write_start(plural) 3900 if isinstance(objs, List): 3901 href = objs.href 3902 if href is not None: 3903 writer.write_attribute('href', href) 3904 for obj in objs: 3905 GracePeriodWriter.write_one(obj, writer, singular) 3906 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3881 @staticmethod 3882 def write_one(obj, writer, singular=None): 3883 if singular is None: 3884 singular = 'grace_period' 3885 writer.write_start(singular) 3886 href = obj.href 3887 if href is not None: 3888 writer.write_attribute('href', href) 3889 if obj.expiry is not None: 3890 Writer.write_integer(writer, 'expiry', obj.expiry) 3891 writer.write_end()
3893 @staticmethod 3894 def write_many(objs, writer, singular=None, plural=None): 3895 if singular is None: 3896 singular = 'grace_period' 3897 if plural is None: 3898 plural = 'grace_periods' 3899 writer.write_start(plural) 3900 if isinstance(objs, List): 3901 href = objs.href 3902 if href is not None: 3903 writer.write_attribute('href', href) 3904 for obj in objs: 3905 GracePeriodWriter.write_one(obj, writer, singular) 3906 writer.write_end()
3909class GraphicsConsoleWriter(Writer): 3910 3911 def __init__(self): 3912 super(GraphicsConsoleWriter, self).__init__() 3913 3914 @staticmethod 3915 def write_one(obj, writer, singular=None): 3916 if singular is None: 3917 singular = 'graphics_console' 3918 writer.write_start(singular) 3919 href = obj.href 3920 if href is not None: 3921 writer.write_attribute('href', href) 3922 if obj.id is not None: 3923 writer.write_attribute('id', obj.id) 3924 if obj.address is not None: 3925 Writer.write_string(writer, 'address', obj.address) 3926 if obj.comment is not None: 3927 Writer.write_string(writer, 'comment', obj.comment) 3928 if obj.description is not None: 3929 Writer.write_string(writer, 'description', obj.description) 3930 if obj.name is not None: 3931 Writer.write_string(writer, 'name', obj.name) 3932 if obj.port is not None: 3933 Writer.write_integer(writer, 'port', obj.port) 3934 if obj.protocol is not None: 3935 Writer.write_string(writer, 'protocol', obj.protocol.value) 3936 if obj.tls_port is not None: 3937 Writer.write_integer(writer, 'tls_port', obj.tls_port) 3938 if obj.instance_type is not None: 3939 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3940 if obj.template is not None: 3941 TemplateWriter.write_one(obj.template, writer, 'template') 3942 if obj.vm is not None: 3943 VmWriter.write_one(obj.vm, writer, 'vm') 3944 writer.write_end() 3945 3946 @staticmethod 3947 def write_many(objs, writer, singular=None, plural=None): 3948 if singular is None: 3949 singular = 'graphics_console' 3950 if plural is None: 3951 plural = 'graphics_consoles' 3952 writer.write_start(plural) 3953 if isinstance(objs, List): 3954 href = objs.href 3955 if href is not None: 3956 writer.write_attribute('href', href) 3957 for obj in objs: 3958 GraphicsConsoleWriter.write_one(obj, writer, singular) 3959 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3914 @staticmethod 3915 def write_one(obj, writer, singular=None): 3916 if singular is None: 3917 singular = 'graphics_console' 3918 writer.write_start(singular) 3919 href = obj.href 3920 if href is not None: 3921 writer.write_attribute('href', href) 3922 if obj.id is not None: 3923 writer.write_attribute('id', obj.id) 3924 if obj.address is not None: 3925 Writer.write_string(writer, 'address', obj.address) 3926 if obj.comment is not None: 3927 Writer.write_string(writer, 'comment', obj.comment) 3928 if obj.description is not None: 3929 Writer.write_string(writer, 'description', obj.description) 3930 if obj.name is not None: 3931 Writer.write_string(writer, 'name', obj.name) 3932 if obj.port is not None: 3933 Writer.write_integer(writer, 'port', obj.port) 3934 if obj.protocol is not None: 3935 Writer.write_string(writer, 'protocol', obj.protocol.value) 3936 if obj.tls_port is not None: 3937 Writer.write_integer(writer, 'tls_port', obj.tls_port) 3938 if obj.instance_type is not None: 3939 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 3940 if obj.template is not None: 3941 TemplateWriter.write_one(obj.template, writer, 'template') 3942 if obj.vm is not None: 3943 VmWriter.write_one(obj.vm, writer, 'vm') 3944 writer.write_end()
3946 @staticmethod 3947 def write_many(objs, writer, singular=None, plural=None): 3948 if singular is None: 3949 singular = 'graphics_console' 3950 if plural is None: 3951 plural = 'graphics_consoles' 3952 writer.write_start(plural) 3953 if isinstance(objs, List): 3954 href = objs.href 3955 if href is not None: 3956 writer.write_attribute('href', href) 3957 for obj in objs: 3958 GraphicsConsoleWriter.write_one(obj, writer, singular) 3959 writer.write_end()
3962class GroupWriter(Writer): 3963 3964 def __init__(self): 3965 super(GroupWriter, self).__init__() 3966 3967 @staticmethod 3968 def write_one(obj, writer, singular=None): 3969 if singular is None: 3970 singular = 'group' 3971 writer.write_start(singular) 3972 href = obj.href 3973 if href is not None: 3974 writer.write_attribute('href', href) 3975 if obj.id is not None: 3976 writer.write_attribute('id', obj.id) 3977 if obj.comment is not None: 3978 Writer.write_string(writer, 'comment', obj.comment) 3979 if obj.description is not None: 3980 Writer.write_string(writer, 'description', obj.description) 3981 if obj.domain_entry_id is not None: 3982 Writer.write_string(writer, 'domain_entry_id', obj.domain_entry_id) 3983 if obj.name is not None: 3984 Writer.write_string(writer, 'name', obj.name) 3985 if obj.namespace is not None: 3986 Writer.write_string(writer, 'namespace', obj.namespace) 3987 if obj.domain is not None: 3988 DomainWriter.write_one(obj.domain, writer, 'domain') 3989 if obj.permissions is not None: 3990 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 3991 if obj.roles is not None: 3992 RoleWriter.write_many(obj.roles, writer, 'role', 'roles') 3993 if obj.tags is not None: 3994 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 3995 writer.write_end() 3996 3997 @staticmethod 3998 def write_many(objs, writer, singular=None, plural=None): 3999 if singular is None: 4000 singular = 'group' 4001 if plural is None: 4002 plural = 'groups' 4003 writer.write_start(plural) 4004 if isinstance(objs, List): 4005 href = objs.href 4006 if href is not None: 4007 writer.write_attribute('href', href) 4008 for obj in objs: 4009 GroupWriter.write_one(obj, writer, singular) 4010 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
3967 @staticmethod 3968 def write_one(obj, writer, singular=None): 3969 if singular is None: 3970 singular = 'group' 3971 writer.write_start(singular) 3972 href = obj.href 3973 if href is not None: 3974 writer.write_attribute('href', href) 3975 if obj.id is not None: 3976 writer.write_attribute('id', obj.id) 3977 if obj.comment is not None: 3978 Writer.write_string(writer, 'comment', obj.comment) 3979 if obj.description is not None: 3980 Writer.write_string(writer, 'description', obj.description) 3981 if obj.domain_entry_id is not None: 3982 Writer.write_string(writer, 'domain_entry_id', obj.domain_entry_id) 3983 if obj.name is not None: 3984 Writer.write_string(writer, 'name', obj.name) 3985 if obj.namespace is not None: 3986 Writer.write_string(writer, 'namespace', obj.namespace) 3987 if obj.domain is not None: 3988 DomainWriter.write_one(obj.domain, writer, 'domain') 3989 if obj.permissions is not None: 3990 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 3991 if obj.roles is not None: 3992 RoleWriter.write_many(obj.roles, writer, 'role', 'roles') 3993 if obj.tags is not None: 3994 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 3995 writer.write_end()
3997 @staticmethod 3998 def write_many(objs, writer, singular=None, plural=None): 3999 if singular is None: 4000 singular = 'group' 4001 if plural is None: 4002 plural = 'groups' 4003 writer.write_start(plural) 4004 if isinstance(objs, List): 4005 href = objs.href 4006 if href is not None: 4007 writer.write_attribute('href', href) 4008 for obj in objs: 4009 GroupWriter.write_one(obj, writer, singular) 4010 writer.write_end()
4013class GuestOperatingSystemWriter(Writer): 4014 4015 def __init__(self): 4016 super(GuestOperatingSystemWriter, self).__init__() 4017 4018 @staticmethod 4019 def write_one(obj, writer, singular=None): 4020 if singular is None: 4021 singular = 'guest_operating_system' 4022 writer.write_start(singular) 4023 href = obj.href 4024 if href is not None: 4025 writer.write_attribute('href', href) 4026 if obj.architecture is not None: 4027 Writer.write_string(writer, 'architecture', obj.architecture) 4028 if obj.codename is not None: 4029 Writer.write_string(writer, 'codename', obj.codename) 4030 if obj.distribution is not None: 4031 Writer.write_string(writer, 'distribution', obj.distribution) 4032 if obj.family is not None: 4033 Writer.write_string(writer, 'family', obj.family) 4034 if obj.kernel is not None: 4035 KernelWriter.write_one(obj.kernel, writer, 'kernel') 4036 if obj.version is not None: 4037 VersionWriter.write_one(obj.version, writer, 'version') 4038 writer.write_end() 4039 4040 @staticmethod 4041 def write_many(objs, writer, singular=None, plural=None): 4042 if singular is None: 4043 singular = 'guest_operating_system' 4044 if plural is None: 4045 plural = 'guest_operating_systems' 4046 writer.write_start(plural) 4047 if isinstance(objs, List): 4048 href = objs.href 4049 if href is not None: 4050 writer.write_attribute('href', href) 4051 for obj in objs: 4052 GuestOperatingSystemWriter.write_one(obj, writer, singular) 4053 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4018 @staticmethod 4019 def write_one(obj, writer, singular=None): 4020 if singular is None: 4021 singular = 'guest_operating_system' 4022 writer.write_start(singular) 4023 href = obj.href 4024 if href is not None: 4025 writer.write_attribute('href', href) 4026 if obj.architecture is not None: 4027 Writer.write_string(writer, 'architecture', obj.architecture) 4028 if obj.codename is not None: 4029 Writer.write_string(writer, 'codename', obj.codename) 4030 if obj.distribution is not None: 4031 Writer.write_string(writer, 'distribution', obj.distribution) 4032 if obj.family is not None: 4033 Writer.write_string(writer, 'family', obj.family) 4034 if obj.kernel is not None: 4035 KernelWriter.write_one(obj.kernel, writer, 'kernel') 4036 if obj.version is not None: 4037 VersionWriter.write_one(obj.version, writer, 'version') 4038 writer.write_end()
4040 @staticmethod 4041 def write_many(objs, writer, singular=None, plural=None): 4042 if singular is None: 4043 singular = 'guest_operating_system' 4044 if plural is None: 4045 plural = 'guest_operating_systems' 4046 writer.write_start(plural) 4047 if isinstance(objs, List): 4048 href = objs.href 4049 if href is not None: 4050 writer.write_attribute('href', href) 4051 for obj in objs: 4052 GuestOperatingSystemWriter.write_one(obj, writer, singular) 4053 writer.write_end()
4056class HardwareInformationWriter(Writer): 4057 4058 def __init__(self): 4059 super(HardwareInformationWriter, self).__init__() 4060 4061 @staticmethod 4062 def write_one(obj, writer, singular=None): 4063 if singular is None: 4064 singular = 'hardware_information' 4065 writer.write_start(singular) 4066 href = obj.href 4067 if href is not None: 4068 writer.write_attribute('href', href) 4069 if obj.family is not None: 4070 Writer.write_string(writer, 'family', obj.family) 4071 if obj.manufacturer is not None: 4072 Writer.write_string(writer, 'manufacturer', obj.manufacturer) 4073 if obj.product_name is not None: 4074 Writer.write_string(writer, 'product_name', obj.product_name) 4075 if obj.serial_number is not None: 4076 Writer.write_string(writer, 'serial_number', obj.serial_number) 4077 if obj.supported_rng_sources is not None: 4078 writer.write_start('supported_rng_sources') 4079 for item in obj.supported_rng_sources: 4080 if item is not None: 4081 Writer.write_string(writer, 'supported_rng_source', item.value) 4082 writer.write_end() 4083 if obj.uuid is not None: 4084 Writer.write_string(writer, 'uuid', obj.uuid) 4085 if obj.version is not None: 4086 Writer.write_string(writer, 'version', obj.version) 4087 writer.write_end() 4088 4089 @staticmethod 4090 def write_many(objs, writer, singular=None, plural=None): 4091 if singular is None: 4092 singular = 'hardware_information' 4093 if plural is None: 4094 plural = 'hardware_informations' 4095 writer.write_start(plural) 4096 if isinstance(objs, List): 4097 href = objs.href 4098 if href is not None: 4099 writer.write_attribute('href', href) 4100 for obj in objs: 4101 HardwareInformationWriter.write_one(obj, writer, singular) 4102 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4061 @staticmethod 4062 def write_one(obj, writer, singular=None): 4063 if singular is None: 4064 singular = 'hardware_information' 4065 writer.write_start(singular) 4066 href = obj.href 4067 if href is not None: 4068 writer.write_attribute('href', href) 4069 if obj.family is not None: 4070 Writer.write_string(writer, 'family', obj.family) 4071 if obj.manufacturer is not None: 4072 Writer.write_string(writer, 'manufacturer', obj.manufacturer) 4073 if obj.product_name is not None: 4074 Writer.write_string(writer, 'product_name', obj.product_name) 4075 if obj.serial_number is not None: 4076 Writer.write_string(writer, 'serial_number', obj.serial_number) 4077 if obj.supported_rng_sources is not None: 4078 writer.write_start('supported_rng_sources') 4079 for item in obj.supported_rng_sources: 4080 if item is not None: 4081 Writer.write_string(writer, 'supported_rng_source', item.value) 4082 writer.write_end() 4083 if obj.uuid is not None: 4084 Writer.write_string(writer, 'uuid', obj.uuid) 4085 if obj.version is not None: 4086 Writer.write_string(writer, 'version', obj.version) 4087 writer.write_end()
4089 @staticmethod 4090 def write_many(objs, writer, singular=None, plural=None): 4091 if singular is None: 4092 singular = 'hardware_information' 4093 if plural is None: 4094 plural = 'hardware_informations' 4095 writer.write_start(plural) 4096 if isinstance(objs, List): 4097 href = objs.href 4098 if href is not None: 4099 writer.write_attribute('href', href) 4100 for obj in objs: 4101 HardwareInformationWriter.write_one(obj, writer, singular) 4102 writer.write_end()
4105class HighAvailabilityWriter(Writer): 4106 4107 def __init__(self): 4108 super(HighAvailabilityWriter, self).__init__() 4109 4110 @staticmethod 4111 def write_one(obj, writer, singular=None): 4112 if singular is None: 4113 singular = 'high_availability' 4114 writer.write_start(singular) 4115 href = obj.href 4116 if href is not None: 4117 writer.write_attribute('href', href) 4118 if obj.enabled is not None: 4119 Writer.write_boolean(writer, 'enabled', obj.enabled) 4120 if obj.priority is not None: 4121 Writer.write_integer(writer, 'priority', obj.priority) 4122 writer.write_end() 4123 4124 @staticmethod 4125 def write_many(objs, writer, singular=None, plural=None): 4126 if singular is None: 4127 singular = 'high_availability' 4128 if plural is None: 4129 plural = 'high_availabilities' 4130 writer.write_start(plural) 4131 if isinstance(objs, List): 4132 href = objs.href 4133 if href is not None: 4134 writer.write_attribute('href', href) 4135 for obj in objs: 4136 HighAvailabilityWriter.write_one(obj, writer, singular) 4137 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4110 @staticmethod 4111 def write_one(obj, writer, singular=None): 4112 if singular is None: 4113 singular = 'high_availability' 4114 writer.write_start(singular) 4115 href = obj.href 4116 if href is not None: 4117 writer.write_attribute('href', href) 4118 if obj.enabled is not None: 4119 Writer.write_boolean(writer, 'enabled', obj.enabled) 4120 if obj.priority is not None: 4121 Writer.write_integer(writer, 'priority', obj.priority) 4122 writer.write_end()
4124 @staticmethod 4125 def write_many(objs, writer, singular=None, plural=None): 4126 if singular is None: 4127 singular = 'high_availability' 4128 if plural is None: 4129 plural = 'high_availabilities' 4130 writer.write_start(plural) 4131 if isinstance(objs, List): 4132 href = objs.href 4133 if href is not None: 4134 writer.write_attribute('href', href) 4135 for obj in objs: 4136 HighAvailabilityWriter.write_one(obj, writer, singular) 4137 writer.write_end()
4140class HookWriter(Writer): 4141 4142 def __init__(self): 4143 super(HookWriter, self).__init__() 4144 4145 @staticmethod 4146 def write_one(obj, writer, singular=None): 4147 if singular is None: 4148 singular = 'hook' 4149 writer.write_start(singular) 4150 href = obj.href 4151 if href is not None: 4152 writer.write_attribute('href', href) 4153 if obj.id is not None: 4154 writer.write_attribute('id', obj.id) 4155 if obj.comment is not None: 4156 Writer.write_string(writer, 'comment', obj.comment) 4157 if obj.description is not None: 4158 Writer.write_string(writer, 'description', obj.description) 4159 if obj.event_name is not None: 4160 Writer.write_string(writer, 'event_name', obj.event_name) 4161 if obj.md5 is not None: 4162 Writer.write_string(writer, 'md5', obj.md5) 4163 if obj.name is not None: 4164 Writer.write_string(writer, 'name', obj.name) 4165 if obj.host is not None: 4166 HostWriter.write_one(obj.host, writer, 'host') 4167 writer.write_end() 4168 4169 @staticmethod 4170 def write_many(objs, writer, singular=None, plural=None): 4171 if singular is None: 4172 singular = 'hook' 4173 if plural is None: 4174 plural = 'hooks' 4175 writer.write_start(plural) 4176 if isinstance(objs, List): 4177 href = objs.href 4178 if href is not None: 4179 writer.write_attribute('href', href) 4180 for obj in objs: 4181 HookWriter.write_one(obj, writer, singular) 4182 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4145 @staticmethod 4146 def write_one(obj, writer, singular=None): 4147 if singular is None: 4148 singular = 'hook' 4149 writer.write_start(singular) 4150 href = obj.href 4151 if href is not None: 4152 writer.write_attribute('href', href) 4153 if obj.id is not None: 4154 writer.write_attribute('id', obj.id) 4155 if obj.comment is not None: 4156 Writer.write_string(writer, 'comment', obj.comment) 4157 if obj.description is not None: 4158 Writer.write_string(writer, 'description', obj.description) 4159 if obj.event_name is not None: 4160 Writer.write_string(writer, 'event_name', obj.event_name) 4161 if obj.md5 is not None: 4162 Writer.write_string(writer, 'md5', obj.md5) 4163 if obj.name is not None: 4164 Writer.write_string(writer, 'name', obj.name) 4165 if obj.host is not None: 4166 HostWriter.write_one(obj.host, writer, 'host') 4167 writer.write_end()
4169 @staticmethod 4170 def write_many(objs, writer, singular=None, plural=None): 4171 if singular is None: 4172 singular = 'hook' 4173 if plural is None: 4174 plural = 'hooks' 4175 writer.write_start(plural) 4176 if isinstance(objs, List): 4177 href = objs.href 4178 if href is not None: 4179 writer.write_attribute('href', href) 4180 for obj in objs: 4181 HookWriter.write_one(obj, writer, singular) 4182 writer.write_end()
4185class HostWriter(Writer): 4186 4187 def __init__(self): 4188 super(HostWriter, self).__init__() 4189 4190 @staticmethod 4191 def write_one(obj, writer, singular=None): 4192 if singular is None: 4193 singular = 'host' 4194 writer.write_start(singular) 4195 href = obj.href 4196 if href is not None: 4197 writer.write_attribute('href', href) 4198 if obj.id is not None: 4199 writer.write_attribute('id', obj.id) 4200 if obj.address is not None: 4201 Writer.write_string(writer, 'address', obj.address) 4202 if obj.auto_numa_status is not None: 4203 Writer.write_string(writer, 'auto_numa_status', obj.auto_numa_status.value) 4204 if obj.certificate is not None: 4205 CertificateWriter.write_one(obj.certificate, writer, 'certificate') 4206 if obj.comment is not None: 4207 Writer.write_string(writer, 'comment', obj.comment) 4208 if obj.cpu is not None: 4209 CpuWriter.write_one(obj.cpu, writer, 'cpu') 4210 if obj.description is not None: 4211 Writer.write_string(writer, 'description', obj.description) 4212 if obj.device_passthrough is not None: 4213 HostDevicePassthroughWriter.write_one(obj.device_passthrough, writer, 'device_passthrough') 4214 if obj.display is not None: 4215 DisplayWriter.write_one(obj.display, writer, 'display') 4216 if obj.external_status is not None: 4217 Writer.write_string(writer, 'external_status', obj.external_status.value) 4218 if obj.hardware_information is not None: 4219 HardwareInformationWriter.write_one(obj.hardware_information, writer, 'hardware_information') 4220 if obj.hosted_engine is not None: 4221 HostedEngineWriter.write_one(obj.hosted_engine, writer, 'hosted_engine') 4222 if obj.iscsi is not None: 4223 IscsiDetailsWriter.write_one(obj.iscsi, writer, 'iscsi') 4224 if obj.kdump_status is not None: 4225 Writer.write_string(writer, 'kdump_status', obj.kdump_status.value) 4226 if obj.ksm is not None: 4227 KsmWriter.write_one(obj.ksm, writer, 'ksm') 4228 if obj.libvirt_version is not None: 4229 VersionWriter.write_one(obj.libvirt_version, writer, 'libvirt_version') 4230 if obj.max_scheduling_memory is not None: 4231 Writer.write_integer(writer, 'max_scheduling_memory', obj.max_scheduling_memory) 4232 if obj.memory is not None: 4233 Writer.write_integer(writer, 'memory', obj.memory) 4234 if obj.name is not None: 4235 Writer.write_string(writer, 'name', obj.name) 4236 if obj.network_operation_in_progress is not None: 4237 Writer.write_boolean(writer, 'network_operation_in_progress', obj.network_operation_in_progress) 4238 if obj.numa_supported is not None: 4239 Writer.write_boolean(writer, 'numa_supported', obj.numa_supported) 4240 if obj.os is not None: 4241 OperatingSystemWriter.write_one(obj.os, writer, 'os') 4242 if obj.override_iptables is not None: 4243 Writer.write_boolean(writer, 'override_iptables', obj.override_iptables) 4244 if obj.ovn_configured is not None: 4245 Writer.write_boolean(writer, 'ovn_configured', obj.ovn_configured) 4246 if obj.port is not None: 4247 Writer.write_integer(writer, 'port', obj.port) 4248 if obj.power_management is not None: 4249 PowerManagementWriter.write_one(obj.power_management, writer, 'power_management') 4250 if obj.protocol is not None: 4251 Writer.write_string(writer, 'protocol', obj.protocol.value) 4252 if obj.reinstallation_required is not None: 4253 Writer.write_boolean(writer, 'reinstallation_required', obj.reinstallation_required) 4254 if obj.root_password is not None: 4255 Writer.write_string(writer, 'root_password', obj.root_password) 4256 if obj.se_linux is not None: 4257 SeLinuxWriter.write_one(obj.se_linux, writer, 'se_linux') 4258 if obj.spm is not None: 4259 SpmWriter.write_one(obj.spm, writer, 'spm') 4260 if obj.ssh is not None: 4261 SshWriter.write_one(obj.ssh, writer, 'ssh') 4262 if obj.status is not None: 4263 Writer.write_string(writer, 'status', obj.status.value) 4264 if obj.status_detail is not None: 4265 Writer.write_string(writer, 'status_detail', obj.status_detail) 4266 if obj.summary is not None: 4267 VmSummaryWriter.write_one(obj.summary, writer, 'summary') 4268 if obj.transparent_huge_pages is not None: 4269 TransparentHugePagesWriter.write_one(obj.transparent_huge_pages, writer, 'transparent_hugepages') 4270 if obj.type is not None: 4271 Writer.write_string(writer, 'type', obj.type.value) 4272 if obj.update_available is not None: 4273 Writer.write_boolean(writer, 'update_available', obj.update_available) 4274 if obj.version is not None: 4275 VersionWriter.write_one(obj.version, writer, 'version') 4276 if obj.vgpu_placement is not None: 4277 Writer.write_string(writer, 'vgpu_placement', obj.vgpu_placement.value) 4278 if obj.affinity_labels is not None: 4279 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 4280 if obj.agents is not None: 4281 AgentWriter.write_many(obj.agents, writer, 'agent', 'agents') 4282 if obj.cluster is not None: 4283 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 4284 if obj.cpu_units is not None: 4285 HostCpuUnitWriter.write_many(obj.cpu_units, writer, 'host_cpu_unit', 'cpu_units') 4286 if obj.devices is not None: 4287 HostDeviceWriter.write_many(obj.devices, writer, 'host_device', 'devices') 4288 if obj.external_host_provider is not None: 4289 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 4290 if obj.external_network_provider_configurations is not None: 4291 ExternalNetworkProviderConfigurationWriter.write_many(obj.external_network_provider_configurations, writer, 'external_network_provider_configuration', 'external_network_provider_configurations') 4292 if obj.hooks is not None: 4293 HookWriter.write_many(obj.hooks, writer, 'hook', 'hooks') 4294 if obj.katello_errata is not None: 4295 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 4296 if obj.network_attachments is not None: 4297 NetworkAttachmentWriter.write_many(obj.network_attachments, writer, 'network_attachment', 'network_attachments') 4298 if obj.nics is not None: 4299 HostNicWriter.write_many(obj.nics, writer, 'host_nic', 'nics') 4300 if obj.numa_nodes is not None: 4301 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 4302 if obj.permissions is not None: 4303 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 4304 if obj.statistics is not None: 4305 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 4306 if obj.storage_connection_extensions is not None: 4307 StorageConnectionExtensionWriter.write_many(obj.storage_connection_extensions, writer, 'storage_connection_extension', 'storage_connection_extensions') 4308 if obj.storages is not None: 4309 HostStorageWriter.write_many(obj.storages, writer, 'host_storage', 'storages') 4310 if obj.tags is not None: 4311 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 4312 if obj.unmanaged_networks is not None: 4313 UnmanagedNetworkWriter.write_many(obj.unmanaged_networks, writer, 'unmanaged_network', 'unmanaged_networks') 4314 writer.write_end() 4315 4316 @staticmethod 4317 def write_many(objs, writer, singular=None, plural=None): 4318 if singular is None: 4319 singular = 'host' 4320 if plural is None: 4321 plural = 'hosts' 4322 writer.write_start(plural) 4323 if isinstance(objs, List): 4324 href = objs.href 4325 if href is not None: 4326 writer.write_attribute('href', href) 4327 for obj in objs: 4328 HostWriter.write_one(obj, writer, singular) 4329 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4190 @staticmethod 4191 def write_one(obj, writer, singular=None): 4192 if singular is None: 4193 singular = 'host' 4194 writer.write_start(singular) 4195 href = obj.href 4196 if href is not None: 4197 writer.write_attribute('href', href) 4198 if obj.id is not None: 4199 writer.write_attribute('id', obj.id) 4200 if obj.address is not None: 4201 Writer.write_string(writer, 'address', obj.address) 4202 if obj.auto_numa_status is not None: 4203 Writer.write_string(writer, 'auto_numa_status', obj.auto_numa_status.value) 4204 if obj.certificate is not None: 4205 CertificateWriter.write_one(obj.certificate, writer, 'certificate') 4206 if obj.comment is not None: 4207 Writer.write_string(writer, 'comment', obj.comment) 4208 if obj.cpu is not None: 4209 CpuWriter.write_one(obj.cpu, writer, 'cpu') 4210 if obj.description is not None: 4211 Writer.write_string(writer, 'description', obj.description) 4212 if obj.device_passthrough is not None: 4213 HostDevicePassthroughWriter.write_one(obj.device_passthrough, writer, 'device_passthrough') 4214 if obj.display is not None: 4215 DisplayWriter.write_one(obj.display, writer, 'display') 4216 if obj.external_status is not None: 4217 Writer.write_string(writer, 'external_status', obj.external_status.value) 4218 if obj.hardware_information is not None: 4219 HardwareInformationWriter.write_one(obj.hardware_information, writer, 'hardware_information') 4220 if obj.hosted_engine is not None: 4221 HostedEngineWriter.write_one(obj.hosted_engine, writer, 'hosted_engine') 4222 if obj.iscsi is not None: 4223 IscsiDetailsWriter.write_one(obj.iscsi, writer, 'iscsi') 4224 if obj.kdump_status is not None: 4225 Writer.write_string(writer, 'kdump_status', obj.kdump_status.value) 4226 if obj.ksm is not None: 4227 KsmWriter.write_one(obj.ksm, writer, 'ksm') 4228 if obj.libvirt_version is not None: 4229 VersionWriter.write_one(obj.libvirt_version, writer, 'libvirt_version') 4230 if obj.max_scheduling_memory is not None: 4231 Writer.write_integer(writer, 'max_scheduling_memory', obj.max_scheduling_memory) 4232 if obj.memory is not None: 4233 Writer.write_integer(writer, 'memory', obj.memory) 4234 if obj.name is not None: 4235 Writer.write_string(writer, 'name', obj.name) 4236 if obj.network_operation_in_progress is not None: 4237 Writer.write_boolean(writer, 'network_operation_in_progress', obj.network_operation_in_progress) 4238 if obj.numa_supported is not None: 4239 Writer.write_boolean(writer, 'numa_supported', obj.numa_supported) 4240 if obj.os is not None: 4241 OperatingSystemWriter.write_one(obj.os, writer, 'os') 4242 if obj.override_iptables is not None: 4243 Writer.write_boolean(writer, 'override_iptables', obj.override_iptables) 4244 if obj.ovn_configured is not None: 4245 Writer.write_boolean(writer, 'ovn_configured', obj.ovn_configured) 4246 if obj.port is not None: 4247 Writer.write_integer(writer, 'port', obj.port) 4248 if obj.power_management is not None: 4249 PowerManagementWriter.write_one(obj.power_management, writer, 'power_management') 4250 if obj.protocol is not None: 4251 Writer.write_string(writer, 'protocol', obj.protocol.value) 4252 if obj.reinstallation_required is not None: 4253 Writer.write_boolean(writer, 'reinstallation_required', obj.reinstallation_required) 4254 if obj.root_password is not None: 4255 Writer.write_string(writer, 'root_password', obj.root_password) 4256 if obj.se_linux is not None: 4257 SeLinuxWriter.write_one(obj.se_linux, writer, 'se_linux') 4258 if obj.spm is not None: 4259 SpmWriter.write_one(obj.spm, writer, 'spm') 4260 if obj.ssh is not None: 4261 SshWriter.write_one(obj.ssh, writer, 'ssh') 4262 if obj.status is not None: 4263 Writer.write_string(writer, 'status', obj.status.value) 4264 if obj.status_detail is not None: 4265 Writer.write_string(writer, 'status_detail', obj.status_detail) 4266 if obj.summary is not None: 4267 VmSummaryWriter.write_one(obj.summary, writer, 'summary') 4268 if obj.transparent_huge_pages is not None: 4269 TransparentHugePagesWriter.write_one(obj.transparent_huge_pages, writer, 'transparent_hugepages') 4270 if obj.type is not None: 4271 Writer.write_string(writer, 'type', obj.type.value) 4272 if obj.update_available is not None: 4273 Writer.write_boolean(writer, 'update_available', obj.update_available) 4274 if obj.version is not None: 4275 VersionWriter.write_one(obj.version, writer, 'version') 4276 if obj.vgpu_placement is not None: 4277 Writer.write_string(writer, 'vgpu_placement', obj.vgpu_placement.value) 4278 if obj.affinity_labels is not None: 4279 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 4280 if obj.agents is not None: 4281 AgentWriter.write_many(obj.agents, writer, 'agent', 'agents') 4282 if obj.cluster is not None: 4283 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 4284 if obj.cpu_units is not None: 4285 HostCpuUnitWriter.write_many(obj.cpu_units, writer, 'host_cpu_unit', 'cpu_units') 4286 if obj.devices is not None: 4287 HostDeviceWriter.write_many(obj.devices, writer, 'host_device', 'devices') 4288 if obj.external_host_provider is not None: 4289 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 4290 if obj.external_network_provider_configurations is not None: 4291 ExternalNetworkProviderConfigurationWriter.write_many(obj.external_network_provider_configurations, writer, 'external_network_provider_configuration', 'external_network_provider_configurations') 4292 if obj.hooks is not None: 4293 HookWriter.write_many(obj.hooks, writer, 'hook', 'hooks') 4294 if obj.katello_errata is not None: 4295 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 4296 if obj.network_attachments is not None: 4297 NetworkAttachmentWriter.write_many(obj.network_attachments, writer, 'network_attachment', 'network_attachments') 4298 if obj.nics is not None: 4299 HostNicWriter.write_many(obj.nics, writer, 'host_nic', 'nics') 4300 if obj.numa_nodes is not None: 4301 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 4302 if obj.permissions is not None: 4303 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 4304 if obj.statistics is not None: 4305 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 4306 if obj.storage_connection_extensions is not None: 4307 StorageConnectionExtensionWriter.write_many(obj.storage_connection_extensions, writer, 'storage_connection_extension', 'storage_connection_extensions') 4308 if obj.storages is not None: 4309 HostStorageWriter.write_many(obj.storages, writer, 'host_storage', 'storages') 4310 if obj.tags is not None: 4311 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 4312 if obj.unmanaged_networks is not None: 4313 UnmanagedNetworkWriter.write_many(obj.unmanaged_networks, writer, 'unmanaged_network', 'unmanaged_networks') 4314 writer.write_end()
4316 @staticmethod 4317 def write_many(objs, writer, singular=None, plural=None): 4318 if singular is None: 4319 singular = 'host' 4320 if plural is None: 4321 plural = 'hosts' 4322 writer.write_start(plural) 4323 if isinstance(objs, List): 4324 href = objs.href 4325 if href is not None: 4326 writer.write_attribute('href', href) 4327 for obj in objs: 4328 HostWriter.write_one(obj, writer, singular) 4329 writer.write_end()
4332class HostCpuUnitWriter(Writer): 4333 4334 def __init__(self): 4335 super(HostCpuUnitWriter, self).__init__() 4336 4337 @staticmethod 4338 def write_one(obj, writer, singular=None): 4339 if singular is None: 4340 singular = 'host_cpu_unit' 4341 writer.write_start(singular) 4342 href = obj.href 4343 if href is not None: 4344 writer.write_attribute('href', href) 4345 if obj.id is not None: 4346 writer.write_attribute('id', obj.id) 4347 if obj.comment is not None: 4348 Writer.write_string(writer, 'comment', obj.comment) 4349 if obj.core_id is not None: 4350 Writer.write_integer(writer, 'core_id', obj.core_id) 4351 if obj.cpu_id is not None: 4352 Writer.write_integer(writer, 'cpu_id', obj.cpu_id) 4353 if obj.description is not None: 4354 Writer.write_string(writer, 'description', obj.description) 4355 if obj.name is not None: 4356 Writer.write_string(writer, 'name', obj.name) 4357 if obj.runs_vdsm is not None: 4358 Writer.write_boolean(writer, 'runs_vdsm', obj.runs_vdsm) 4359 if obj.socket_id is not None: 4360 Writer.write_integer(writer, 'socket_id', obj.socket_id) 4361 if obj.vms is not None: 4362 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 4363 writer.write_end() 4364 4365 @staticmethod 4366 def write_many(objs, writer, singular=None, plural=None): 4367 if singular is None: 4368 singular = 'host_cpu_unit' 4369 if plural is None: 4370 plural = 'host_cpu_units' 4371 writer.write_start(plural) 4372 if isinstance(objs, List): 4373 href = objs.href 4374 if href is not None: 4375 writer.write_attribute('href', href) 4376 for obj in objs: 4377 HostCpuUnitWriter.write_one(obj, writer, singular) 4378 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4337 @staticmethod 4338 def write_one(obj, writer, singular=None): 4339 if singular is None: 4340 singular = 'host_cpu_unit' 4341 writer.write_start(singular) 4342 href = obj.href 4343 if href is not None: 4344 writer.write_attribute('href', href) 4345 if obj.id is not None: 4346 writer.write_attribute('id', obj.id) 4347 if obj.comment is not None: 4348 Writer.write_string(writer, 'comment', obj.comment) 4349 if obj.core_id is not None: 4350 Writer.write_integer(writer, 'core_id', obj.core_id) 4351 if obj.cpu_id is not None: 4352 Writer.write_integer(writer, 'cpu_id', obj.cpu_id) 4353 if obj.description is not None: 4354 Writer.write_string(writer, 'description', obj.description) 4355 if obj.name is not None: 4356 Writer.write_string(writer, 'name', obj.name) 4357 if obj.runs_vdsm is not None: 4358 Writer.write_boolean(writer, 'runs_vdsm', obj.runs_vdsm) 4359 if obj.socket_id is not None: 4360 Writer.write_integer(writer, 'socket_id', obj.socket_id) 4361 if obj.vms is not None: 4362 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 4363 writer.write_end()
4365 @staticmethod 4366 def write_many(objs, writer, singular=None, plural=None): 4367 if singular is None: 4368 singular = 'host_cpu_unit' 4369 if plural is None: 4370 plural = 'host_cpu_units' 4371 writer.write_start(plural) 4372 if isinstance(objs, List): 4373 href = objs.href 4374 if href is not None: 4375 writer.write_attribute('href', href) 4376 for obj in objs: 4377 HostCpuUnitWriter.write_one(obj, writer, singular) 4378 writer.write_end()
4381class HostDeviceWriter(Writer): 4382 4383 def __init__(self): 4384 super(HostDeviceWriter, self).__init__() 4385 4386 @staticmethod 4387 def write_one(obj, writer, singular=None): 4388 if singular is None: 4389 singular = 'host_device' 4390 writer.write_start(singular) 4391 href = obj.href 4392 if href is not None: 4393 writer.write_attribute('href', href) 4394 if obj.id is not None: 4395 writer.write_attribute('id', obj.id) 4396 if obj.capability is not None: 4397 Writer.write_string(writer, 'capability', obj.capability) 4398 if obj.comment is not None: 4399 Writer.write_string(writer, 'comment', obj.comment) 4400 if obj.description is not None: 4401 Writer.write_string(writer, 'description', obj.description) 4402 if obj.driver is not None: 4403 Writer.write_string(writer, 'driver', obj.driver) 4404 if obj.iommu_group is not None: 4405 Writer.write_integer(writer, 'iommu_group', obj.iommu_group) 4406 if obj.m_dev_types is not None: 4407 MDevTypeWriter.write_many(obj.m_dev_types, writer, 'm_dev_type', 'm_dev_types') 4408 if obj.name is not None: 4409 Writer.write_string(writer, 'name', obj.name) 4410 if obj.physical_function is not None: 4411 HostDeviceWriter.write_one(obj.physical_function, writer, 'physical_function') 4412 if obj.placeholder is not None: 4413 Writer.write_boolean(writer, 'placeholder', obj.placeholder) 4414 if obj.product is not None: 4415 ProductWriter.write_one(obj.product, writer, 'product') 4416 if obj.vendor is not None: 4417 VendorWriter.write_one(obj.vendor, writer, 'vendor') 4418 if obj.virtual_functions is not None: 4419 Writer.write_integer(writer, 'virtual_functions', obj.virtual_functions) 4420 if obj.host is not None: 4421 HostWriter.write_one(obj.host, writer, 'host') 4422 if obj.parent_device is not None: 4423 HostDeviceWriter.write_one(obj.parent_device, writer, 'parent_device') 4424 if obj.vm is not None: 4425 VmWriter.write_one(obj.vm, writer, 'vm') 4426 writer.write_end() 4427 4428 @staticmethod 4429 def write_many(objs, writer, singular=None, plural=None): 4430 if singular is None: 4431 singular = 'host_device' 4432 if plural is None: 4433 plural = 'host_devices' 4434 writer.write_start(plural) 4435 if isinstance(objs, List): 4436 href = objs.href 4437 if href is not None: 4438 writer.write_attribute('href', href) 4439 for obj in objs: 4440 HostDeviceWriter.write_one(obj, writer, singular) 4441 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4386 @staticmethod 4387 def write_one(obj, writer, singular=None): 4388 if singular is None: 4389 singular = 'host_device' 4390 writer.write_start(singular) 4391 href = obj.href 4392 if href is not None: 4393 writer.write_attribute('href', href) 4394 if obj.id is not None: 4395 writer.write_attribute('id', obj.id) 4396 if obj.capability is not None: 4397 Writer.write_string(writer, 'capability', obj.capability) 4398 if obj.comment is not None: 4399 Writer.write_string(writer, 'comment', obj.comment) 4400 if obj.description is not None: 4401 Writer.write_string(writer, 'description', obj.description) 4402 if obj.driver is not None: 4403 Writer.write_string(writer, 'driver', obj.driver) 4404 if obj.iommu_group is not None: 4405 Writer.write_integer(writer, 'iommu_group', obj.iommu_group) 4406 if obj.m_dev_types is not None: 4407 MDevTypeWriter.write_many(obj.m_dev_types, writer, 'm_dev_type', 'm_dev_types') 4408 if obj.name is not None: 4409 Writer.write_string(writer, 'name', obj.name) 4410 if obj.physical_function is not None: 4411 HostDeviceWriter.write_one(obj.physical_function, writer, 'physical_function') 4412 if obj.placeholder is not None: 4413 Writer.write_boolean(writer, 'placeholder', obj.placeholder) 4414 if obj.product is not None: 4415 ProductWriter.write_one(obj.product, writer, 'product') 4416 if obj.vendor is not None: 4417 VendorWriter.write_one(obj.vendor, writer, 'vendor') 4418 if obj.virtual_functions is not None: 4419 Writer.write_integer(writer, 'virtual_functions', obj.virtual_functions) 4420 if obj.host is not None: 4421 HostWriter.write_one(obj.host, writer, 'host') 4422 if obj.parent_device is not None: 4423 HostDeviceWriter.write_one(obj.parent_device, writer, 'parent_device') 4424 if obj.vm is not None: 4425 VmWriter.write_one(obj.vm, writer, 'vm') 4426 writer.write_end()
4428 @staticmethod 4429 def write_many(objs, writer, singular=None, plural=None): 4430 if singular is None: 4431 singular = 'host_device' 4432 if plural is None: 4433 plural = 'host_devices' 4434 writer.write_start(plural) 4435 if isinstance(objs, List): 4436 href = objs.href 4437 if href is not None: 4438 writer.write_attribute('href', href) 4439 for obj in objs: 4440 HostDeviceWriter.write_one(obj, writer, singular) 4441 writer.write_end()
4444class HostDevicePassthroughWriter(Writer): 4445 4446 def __init__(self): 4447 super(HostDevicePassthroughWriter, self).__init__() 4448 4449 @staticmethod 4450 def write_one(obj, writer, singular=None): 4451 if singular is None: 4452 singular = 'host_device_passthrough' 4453 writer.write_start(singular) 4454 href = obj.href 4455 if href is not None: 4456 writer.write_attribute('href', href) 4457 if obj.enabled is not None: 4458 Writer.write_boolean(writer, 'enabled', obj.enabled) 4459 writer.write_end() 4460 4461 @staticmethod 4462 def write_many(objs, writer, singular=None, plural=None): 4463 if singular is None: 4464 singular = 'host_device_passthrough' 4465 if plural is None: 4466 plural = 'host_device_passthroughs' 4467 writer.write_start(plural) 4468 if isinstance(objs, List): 4469 href = objs.href 4470 if href is not None: 4471 writer.write_attribute('href', href) 4472 for obj in objs: 4473 HostDevicePassthroughWriter.write_one(obj, writer, singular) 4474 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4449 @staticmethod 4450 def write_one(obj, writer, singular=None): 4451 if singular is None: 4452 singular = 'host_device_passthrough' 4453 writer.write_start(singular) 4454 href = obj.href 4455 if href is not None: 4456 writer.write_attribute('href', href) 4457 if obj.enabled is not None: 4458 Writer.write_boolean(writer, 'enabled', obj.enabled) 4459 writer.write_end()
4461 @staticmethod 4462 def write_many(objs, writer, singular=None, plural=None): 4463 if singular is None: 4464 singular = 'host_device_passthrough' 4465 if plural is None: 4466 plural = 'host_device_passthroughs' 4467 writer.write_start(plural) 4468 if isinstance(objs, List): 4469 href = objs.href 4470 if href is not None: 4471 writer.write_attribute('href', href) 4472 for obj in objs: 4473 HostDevicePassthroughWriter.write_one(obj, writer, singular) 4474 writer.write_end()
4477class HostNicWriter(Writer): 4478 4479 def __init__(self): 4480 super(HostNicWriter, self).__init__() 4481 4482 @staticmethod 4483 def write_one(obj, writer, singular=None): 4484 if singular is None: 4485 singular = 'host_nic' 4486 writer.write_start(singular) 4487 href = obj.href 4488 if href is not None: 4489 writer.write_attribute('href', href) 4490 if obj.id is not None: 4491 writer.write_attribute('id', obj.id) 4492 if obj.ad_aggregator_id is not None: 4493 Writer.write_integer(writer, 'ad_aggregator_id', obj.ad_aggregator_id) 4494 if obj.base_interface is not None: 4495 Writer.write_string(writer, 'base_interface', obj.base_interface) 4496 if obj.bonding is not None: 4497 BondingWriter.write_one(obj.bonding, writer, 'bonding') 4498 if obj.boot_protocol is not None: 4499 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 4500 if obj.bridged is not None: 4501 Writer.write_boolean(writer, 'bridged', obj.bridged) 4502 if obj.check_connectivity is not None: 4503 Writer.write_boolean(writer, 'check_connectivity', obj.check_connectivity) 4504 if obj.comment is not None: 4505 Writer.write_string(writer, 'comment', obj.comment) 4506 if obj.custom_configuration is not None: 4507 Writer.write_boolean(writer, 'custom_configuration', obj.custom_configuration) 4508 if obj.description is not None: 4509 Writer.write_string(writer, 'description', obj.description) 4510 if obj.ip is not None: 4511 IpWriter.write_one(obj.ip, writer, 'ip') 4512 if obj.ipv6 is not None: 4513 IpWriter.write_one(obj.ipv6, writer, 'ipv6') 4514 if obj.ipv6_boot_protocol is not None: 4515 Writer.write_string(writer, 'ipv6_boot_protocol', obj.ipv6_boot_protocol.value) 4516 if obj.mac is not None: 4517 MacWriter.write_one(obj.mac, writer, 'mac') 4518 if obj.mtu is not None: 4519 Writer.write_integer(writer, 'mtu', obj.mtu) 4520 if obj.name is not None: 4521 Writer.write_string(writer, 'name', obj.name) 4522 if obj.override_configuration is not None: 4523 Writer.write_boolean(writer, 'override_configuration', obj.override_configuration) 4524 if obj.properties is not None: 4525 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 4526 if obj.speed is not None: 4527 Writer.write_integer(writer, 'speed', obj.speed) 4528 if obj.status is not None: 4529 Writer.write_string(writer, 'status', obj.status.value) 4530 if obj.virtual_functions_configuration is not None: 4531 HostNicVirtualFunctionsConfigurationWriter.write_one(obj.virtual_functions_configuration, writer, 'virtual_functions_configuration') 4532 if obj.vlan is not None: 4533 VlanWriter.write_one(obj.vlan, writer, 'vlan') 4534 if obj.host is not None: 4535 HostWriter.write_one(obj.host, writer, 'host') 4536 if obj.network is not None: 4537 NetworkWriter.write_one(obj.network, writer, 'network') 4538 if obj.network_labels is not None: 4539 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 4540 if obj.physical_function is not None: 4541 HostNicWriter.write_one(obj.physical_function, writer, 'physical_function') 4542 if obj.qos is not None: 4543 QosWriter.write_one(obj.qos, writer, 'qos') 4544 if obj.statistics is not None: 4545 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 4546 writer.write_end() 4547 4548 @staticmethod 4549 def write_many(objs, writer, singular=None, plural=None): 4550 if singular is None: 4551 singular = 'host_nic' 4552 if plural is None: 4553 plural = 'host_nics' 4554 writer.write_start(plural) 4555 if isinstance(objs, List): 4556 href = objs.href 4557 if href is not None: 4558 writer.write_attribute('href', href) 4559 for obj in objs: 4560 HostNicWriter.write_one(obj, writer, singular) 4561 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4482 @staticmethod 4483 def write_one(obj, writer, singular=None): 4484 if singular is None: 4485 singular = 'host_nic' 4486 writer.write_start(singular) 4487 href = obj.href 4488 if href is not None: 4489 writer.write_attribute('href', href) 4490 if obj.id is not None: 4491 writer.write_attribute('id', obj.id) 4492 if obj.ad_aggregator_id is not None: 4493 Writer.write_integer(writer, 'ad_aggregator_id', obj.ad_aggregator_id) 4494 if obj.base_interface is not None: 4495 Writer.write_string(writer, 'base_interface', obj.base_interface) 4496 if obj.bonding is not None: 4497 BondingWriter.write_one(obj.bonding, writer, 'bonding') 4498 if obj.boot_protocol is not None: 4499 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 4500 if obj.bridged is not None: 4501 Writer.write_boolean(writer, 'bridged', obj.bridged) 4502 if obj.check_connectivity is not None: 4503 Writer.write_boolean(writer, 'check_connectivity', obj.check_connectivity) 4504 if obj.comment is not None: 4505 Writer.write_string(writer, 'comment', obj.comment) 4506 if obj.custom_configuration is not None: 4507 Writer.write_boolean(writer, 'custom_configuration', obj.custom_configuration) 4508 if obj.description is not None: 4509 Writer.write_string(writer, 'description', obj.description) 4510 if obj.ip is not None: 4511 IpWriter.write_one(obj.ip, writer, 'ip') 4512 if obj.ipv6 is not None: 4513 IpWriter.write_one(obj.ipv6, writer, 'ipv6') 4514 if obj.ipv6_boot_protocol is not None: 4515 Writer.write_string(writer, 'ipv6_boot_protocol', obj.ipv6_boot_protocol.value) 4516 if obj.mac is not None: 4517 MacWriter.write_one(obj.mac, writer, 'mac') 4518 if obj.mtu is not None: 4519 Writer.write_integer(writer, 'mtu', obj.mtu) 4520 if obj.name is not None: 4521 Writer.write_string(writer, 'name', obj.name) 4522 if obj.override_configuration is not None: 4523 Writer.write_boolean(writer, 'override_configuration', obj.override_configuration) 4524 if obj.properties is not None: 4525 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 4526 if obj.speed is not None: 4527 Writer.write_integer(writer, 'speed', obj.speed) 4528 if obj.status is not None: 4529 Writer.write_string(writer, 'status', obj.status.value) 4530 if obj.virtual_functions_configuration is not None: 4531 HostNicVirtualFunctionsConfigurationWriter.write_one(obj.virtual_functions_configuration, writer, 'virtual_functions_configuration') 4532 if obj.vlan is not None: 4533 VlanWriter.write_one(obj.vlan, writer, 'vlan') 4534 if obj.host is not None: 4535 HostWriter.write_one(obj.host, writer, 'host') 4536 if obj.network is not None: 4537 NetworkWriter.write_one(obj.network, writer, 'network') 4538 if obj.network_labels is not None: 4539 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 4540 if obj.physical_function is not None: 4541 HostNicWriter.write_one(obj.physical_function, writer, 'physical_function') 4542 if obj.qos is not None: 4543 QosWriter.write_one(obj.qos, writer, 'qos') 4544 if obj.statistics is not None: 4545 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 4546 writer.write_end()
4548 @staticmethod 4549 def write_many(objs, writer, singular=None, plural=None): 4550 if singular is None: 4551 singular = 'host_nic' 4552 if plural is None: 4553 plural = 'host_nics' 4554 writer.write_start(plural) 4555 if isinstance(objs, List): 4556 href = objs.href 4557 if href is not None: 4558 writer.write_attribute('href', href) 4559 for obj in objs: 4560 HostNicWriter.write_one(obj, writer, singular) 4561 writer.write_end()
4564class HostNicVirtualFunctionsConfigurationWriter(Writer): 4565 4566 def __init__(self): 4567 super(HostNicVirtualFunctionsConfigurationWriter, self).__init__() 4568 4569 @staticmethod 4570 def write_one(obj, writer, singular=None): 4571 if singular is None: 4572 singular = 'host_nic_virtual_functions_configuration' 4573 writer.write_start(singular) 4574 href = obj.href 4575 if href is not None: 4576 writer.write_attribute('href', href) 4577 if obj.all_networks_allowed is not None: 4578 Writer.write_boolean(writer, 'all_networks_allowed', obj.all_networks_allowed) 4579 if obj.max_number_of_virtual_functions is not None: 4580 Writer.write_integer(writer, 'max_number_of_virtual_functions', obj.max_number_of_virtual_functions) 4581 if obj.number_of_virtual_functions is not None: 4582 Writer.write_integer(writer, 'number_of_virtual_functions', obj.number_of_virtual_functions) 4583 writer.write_end() 4584 4585 @staticmethod 4586 def write_many(objs, writer, singular=None, plural=None): 4587 if singular is None: 4588 singular = 'host_nic_virtual_functions_configuration' 4589 if plural is None: 4590 plural = 'host_nic_virtual_functions_configurations' 4591 writer.write_start(plural) 4592 if isinstance(objs, List): 4593 href = objs.href 4594 if href is not None: 4595 writer.write_attribute('href', href) 4596 for obj in objs: 4597 HostNicVirtualFunctionsConfigurationWriter.write_one(obj, writer, singular) 4598 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4569 @staticmethod 4570 def write_one(obj, writer, singular=None): 4571 if singular is None: 4572 singular = 'host_nic_virtual_functions_configuration' 4573 writer.write_start(singular) 4574 href = obj.href 4575 if href is not None: 4576 writer.write_attribute('href', href) 4577 if obj.all_networks_allowed is not None: 4578 Writer.write_boolean(writer, 'all_networks_allowed', obj.all_networks_allowed) 4579 if obj.max_number_of_virtual_functions is not None: 4580 Writer.write_integer(writer, 'max_number_of_virtual_functions', obj.max_number_of_virtual_functions) 4581 if obj.number_of_virtual_functions is not None: 4582 Writer.write_integer(writer, 'number_of_virtual_functions', obj.number_of_virtual_functions) 4583 writer.write_end()
4585 @staticmethod 4586 def write_many(objs, writer, singular=None, plural=None): 4587 if singular is None: 4588 singular = 'host_nic_virtual_functions_configuration' 4589 if plural is None: 4590 plural = 'host_nic_virtual_functions_configurations' 4591 writer.write_start(plural) 4592 if isinstance(objs, List): 4593 href = objs.href 4594 if href is not None: 4595 writer.write_attribute('href', href) 4596 for obj in objs: 4597 HostNicVirtualFunctionsConfigurationWriter.write_one(obj, writer, singular) 4598 writer.write_end()
4601class HostStorageWriter(Writer): 4602 4603 def __init__(self): 4604 super(HostStorageWriter, self).__init__() 4605 4606 @staticmethod 4607 def write_one(obj, writer, singular=None): 4608 if singular is None: 4609 singular = 'host_storage' 4610 writer.write_start(singular) 4611 href = obj.href 4612 if href is not None: 4613 writer.write_attribute('href', href) 4614 if obj.id is not None: 4615 writer.write_attribute('id', obj.id) 4616 if obj.address is not None: 4617 Writer.write_string(writer, 'address', obj.address) 4618 if obj.comment is not None: 4619 Writer.write_string(writer, 'comment', obj.comment) 4620 if obj.description is not None: 4621 Writer.write_string(writer, 'description', obj.description) 4622 if obj.driver_options is not None: 4623 PropertyWriter.write_many(obj.driver_options, writer, 'property', 'driver_options') 4624 if obj.driver_sensitive_options is not None: 4625 PropertyWriter.write_many(obj.driver_sensitive_options, writer, 'property', 'driver_sensitive_options') 4626 if obj.logical_units is not None: 4627 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 4628 if obj.mount_options is not None: 4629 Writer.write_string(writer, 'mount_options', obj.mount_options) 4630 if obj.name is not None: 4631 Writer.write_string(writer, 'name', obj.name) 4632 if obj.nfs_retrans is not None: 4633 Writer.write_integer(writer, 'nfs_retrans', obj.nfs_retrans) 4634 if obj.nfs_timeo is not None: 4635 Writer.write_integer(writer, 'nfs_timeo', obj.nfs_timeo) 4636 if obj.nfs_version is not None: 4637 Writer.write_string(writer, 'nfs_version', obj.nfs_version.value) 4638 if obj.override_luns is not None: 4639 Writer.write_boolean(writer, 'override_luns', obj.override_luns) 4640 if obj.password is not None: 4641 Writer.write_string(writer, 'password', obj.password) 4642 if obj.path is not None: 4643 Writer.write_string(writer, 'path', obj.path) 4644 if obj.port is not None: 4645 Writer.write_integer(writer, 'port', obj.port) 4646 if obj.portal is not None: 4647 Writer.write_string(writer, 'portal', obj.portal) 4648 if obj.target is not None: 4649 Writer.write_string(writer, 'target', obj.target) 4650 if obj.type is not None: 4651 Writer.write_string(writer, 'type', obj.type.value) 4652 if obj.username is not None: 4653 Writer.write_string(writer, 'username', obj.username) 4654 if obj.vfs_type is not None: 4655 Writer.write_string(writer, 'vfs_type', obj.vfs_type) 4656 if obj.volume_group is not None: 4657 VolumeGroupWriter.write_one(obj.volume_group, writer, 'volume_group') 4658 if obj.host is not None: 4659 HostWriter.write_one(obj.host, writer, 'host') 4660 writer.write_end() 4661 4662 @staticmethod 4663 def write_many(objs, writer, singular=None, plural=None): 4664 if singular is None: 4665 singular = 'host_storage' 4666 if plural is None: 4667 plural = 'host_storages' 4668 writer.write_start(plural) 4669 if isinstance(objs, List): 4670 href = objs.href 4671 if href is not None: 4672 writer.write_attribute('href', href) 4673 for obj in objs: 4674 HostStorageWriter.write_one(obj, writer, singular) 4675 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4606 @staticmethod 4607 def write_one(obj, writer, singular=None): 4608 if singular is None: 4609 singular = 'host_storage' 4610 writer.write_start(singular) 4611 href = obj.href 4612 if href is not None: 4613 writer.write_attribute('href', href) 4614 if obj.id is not None: 4615 writer.write_attribute('id', obj.id) 4616 if obj.address is not None: 4617 Writer.write_string(writer, 'address', obj.address) 4618 if obj.comment is not None: 4619 Writer.write_string(writer, 'comment', obj.comment) 4620 if obj.description is not None: 4621 Writer.write_string(writer, 'description', obj.description) 4622 if obj.driver_options is not None: 4623 PropertyWriter.write_many(obj.driver_options, writer, 'property', 'driver_options') 4624 if obj.driver_sensitive_options is not None: 4625 PropertyWriter.write_many(obj.driver_sensitive_options, writer, 'property', 'driver_sensitive_options') 4626 if obj.logical_units is not None: 4627 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 4628 if obj.mount_options is not None: 4629 Writer.write_string(writer, 'mount_options', obj.mount_options) 4630 if obj.name is not None: 4631 Writer.write_string(writer, 'name', obj.name) 4632 if obj.nfs_retrans is not None: 4633 Writer.write_integer(writer, 'nfs_retrans', obj.nfs_retrans) 4634 if obj.nfs_timeo is not None: 4635 Writer.write_integer(writer, 'nfs_timeo', obj.nfs_timeo) 4636 if obj.nfs_version is not None: 4637 Writer.write_string(writer, 'nfs_version', obj.nfs_version.value) 4638 if obj.override_luns is not None: 4639 Writer.write_boolean(writer, 'override_luns', obj.override_luns) 4640 if obj.password is not None: 4641 Writer.write_string(writer, 'password', obj.password) 4642 if obj.path is not None: 4643 Writer.write_string(writer, 'path', obj.path) 4644 if obj.port is not None: 4645 Writer.write_integer(writer, 'port', obj.port) 4646 if obj.portal is not None: 4647 Writer.write_string(writer, 'portal', obj.portal) 4648 if obj.target is not None: 4649 Writer.write_string(writer, 'target', obj.target) 4650 if obj.type is not None: 4651 Writer.write_string(writer, 'type', obj.type.value) 4652 if obj.username is not None: 4653 Writer.write_string(writer, 'username', obj.username) 4654 if obj.vfs_type is not None: 4655 Writer.write_string(writer, 'vfs_type', obj.vfs_type) 4656 if obj.volume_group is not None: 4657 VolumeGroupWriter.write_one(obj.volume_group, writer, 'volume_group') 4658 if obj.host is not None: 4659 HostWriter.write_one(obj.host, writer, 'host') 4660 writer.write_end()
4662 @staticmethod 4663 def write_many(objs, writer, singular=None, plural=None): 4664 if singular is None: 4665 singular = 'host_storage' 4666 if plural is None: 4667 plural = 'host_storages' 4668 writer.write_start(plural) 4669 if isinstance(objs, List): 4670 href = objs.href 4671 if href is not None: 4672 writer.write_attribute('href', href) 4673 for obj in objs: 4674 HostStorageWriter.write_one(obj, writer, singular) 4675 writer.write_end()
4678class HostedEngineWriter(Writer): 4679 4680 def __init__(self): 4681 super(HostedEngineWriter, self).__init__() 4682 4683 @staticmethod 4684 def write_one(obj, writer, singular=None): 4685 if singular is None: 4686 singular = 'hosted_engine' 4687 writer.write_start(singular) 4688 href = obj.href 4689 if href is not None: 4690 writer.write_attribute('href', href) 4691 if obj.active is not None: 4692 Writer.write_boolean(writer, 'active', obj.active) 4693 if obj.configured is not None: 4694 Writer.write_boolean(writer, 'configured', obj.configured) 4695 if obj.global_maintenance is not None: 4696 Writer.write_boolean(writer, 'global_maintenance', obj.global_maintenance) 4697 if obj.local_maintenance is not None: 4698 Writer.write_boolean(writer, 'local_maintenance', obj.local_maintenance) 4699 if obj.score is not None: 4700 Writer.write_integer(writer, 'score', obj.score) 4701 writer.write_end() 4702 4703 @staticmethod 4704 def write_many(objs, writer, singular=None, plural=None): 4705 if singular is None: 4706 singular = 'hosted_engine' 4707 if plural is None: 4708 plural = 'hosted_engines' 4709 writer.write_start(plural) 4710 if isinstance(objs, List): 4711 href = objs.href 4712 if href is not None: 4713 writer.write_attribute('href', href) 4714 for obj in objs: 4715 HostedEngineWriter.write_one(obj, writer, singular) 4716 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4683 @staticmethod 4684 def write_one(obj, writer, singular=None): 4685 if singular is None: 4686 singular = 'hosted_engine' 4687 writer.write_start(singular) 4688 href = obj.href 4689 if href is not None: 4690 writer.write_attribute('href', href) 4691 if obj.active is not None: 4692 Writer.write_boolean(writer, 'active', obj.active) 4693 if obj.configured is not None: 4694 Writer.write_boolean(writer, 'configured', obj.configured) 4695 if obj.global_maintenance is not None: 4696 Writer.write_boolean(writer, 'global_maintenance', obj.global_maintenance) 4697 if obj.local_maintenance is not None: 4698 Writer.write_boolean(writer, 'local_maintenance', obj.local_maintenance) 4699 if obj.score is not None: 4700 Writer.write_integer(writer, 'score', obj.score) 4701 writer.write_end()
4703 @staticmethod 4704 def write_many(objs, writer, singular=None, plural=None): 4705 if singular is None: 4706 singular = 'hosted_engine' 4707 if plural is None: 4708 plural = 'hosted_engines' 4709 writer.write_start(plural) 4710 if isinstance(objs, List): 4711 href = objs.href 4712 if href is not None: 4713 writer.write_attribute('href', href) 4714 for obj in objs: 4715 HostedEngineWriter.write_one(obj, writer, singular) 4716 writer.write_end()
4719class IconWriter(Writer): 4720 4721 def __init__(self): 4722 super(IconWriter, self).__init__() 4723 4724 @staticmethod 4725 def write_one(obj, writer, singular=None): 4726 if singular is None: 4727 singular = 'icon' 4728 writer.write_start(singular) 4729 href = obj.href 4730 if href is not None: 4731 writer.write_attribute('href', href) 4732 if obj.id is not None: 4733 writer.write_attribute('id', obj.id) 4734 if obj.comment is not None: 4735 Writer.write_string(writer, 'comment', obj.comment) 4736 if obj.data is not None: 4737 Writer.write_string(writer, 'data', obj.data) 4738 if obj.description is not None: 4739 Writer.write_string(writer, 'description', obj.description) 4740 if obj.media_type is not None: 4741 Writer.write_string(writer, 'media_type', obj.media_type) 4742 if obj.name is not None: 4743 Writer.write_string(writer, 'name', obj.name) 4744 writer.write_end() 4745 4746 @staticmethod 4747 def write_many(objs, writer, singular=None, plural=None): 4748 if singular is None: 4749 singular = 'icon' 4750 if plural is None: 4751 plural = 'icons' 4752 writer.write_start(plural) 4753 if isinstance(objs, List): 4754 href = objs.href 4755 if href is not None: 4756 writer.write_attribute('href', href) 4757 for obj in objs: 4758 IconWriter.write_one(obj, writer, singular) 4759 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4724 @staticmethod 4725 def write_one(obj, writer, singular=None): 4726 if singular is None: 4727 singular = 'icon' 4728 writer.write_start(singular) 4729 href = obj.href 4730 if href is not None: 4731 writer.write_attribute('href', href) 4732 if obj.id is not None: 4733 writer.write_attribute('id', obj.id) 4734 if obj.comment is not None: 4735 Writer.write_string(writer, 'comment', obj.comment) 4736 if obj.data is not None: 4737 Writer.write_string(writer, 'data', obj.data) 4738 if obj.description is not None: 4739 Writer.write_string(writer, 'description', obj.description) 4740 if obj.media_type is not None: 4741 Writer.write_string(writer, 'media_type', obj.media_type) 4742 if obj.name is not None: 4743 Writer.write_string(writer, 'name', obj.name) 4744 writer.write_end()
4746 @staticmethod 4747 def write_many(objs, writer, singular=None, plural=None): 4748 if singular is None: 4749 singular = 'icon' 4750 if plural is None: 4751 plural = 'icons' 4752 writer.write_start(plural) 4753 if isinstance(objs, List): 4754 href = objs.href 4755 if href is not None: 4756 writer.write_attribute('href', href) 4757 for obj in objs: 4758 IconWriter.write_one(obj, writer, singular) 4759 writer.write_end()
4762class IdentifiedWriter(Writer): 4763 4764 def __init__(self): 4765 super(IdentifiedWriter, self).__init__() 4766 4767 @staticmethod 4768 def write_one(obj, writer, singular=None): 4769 if singular is None: 4770 singular = 'identified' 4771 writer.write_start(singular) 4772 href = obj.href 4773 if href is not None: 4774 writer.write_attribute('href', href) 4775 if obj.id is not None: 4776 writer.write_attribute('id', obj.id) 4777 if obj.comment is not None: 4778 Writer.write_string(writer, 'comment', obj.comment) 4779 if obj.description is not None: 4780 Writer.write_string(writer, 'description', obj.description) 4781 if obj.name is not None: 4782 Writer.write_string(writer, 'name', obj.name) 4783 writer.write_end() 4784 4785 @staticmethod 4786 def write_many(objs, writer, singular=None, plural=None): 4787 if singular is None: 4788 singular = 'identified' 4789 if plural is None: 4790 plural = 'identifieds' 4791 writer.write_start(plural) 4792 if isinstance(objs, List): 4793 href = objs.href 4794 if href is not None: 4795 writer.write_attribute('href', href) 4796 for obj in objs: 4797 IdentifiedWriter.write_one(obj, writer, singular) 4798 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4767 @staticmethod 4768 def write_one(obj, writer, singular=None): 4769 if singular is None: 4770 singular = 'identified' 4771 writer.write_start(singular) 4772 href = obj.href 4773 if href is not None: 4774 writer.write_attribute('href', href) 4775 if obj.id is not None: 4776 writer.write_attribute('id', obj.id) 4777 if obj.comment is not None: 4778 Writer.write_string(writer, 'comment', obj.comment) 4779 if obj.description is not None: 4780 Writer.write_string(writer, 'description', obj.description) 4781 if obj.name is not None: 4782 Writer.write_string(writer, 'name', obj.name) 4783 writer.write_end()
4785 @staticmethod 4786 def write_many(objs, writer, singular=None, plural=None): 4787 if singular is None: 4788 singular = 'identified' 4789 if plural is None: 4790 plural = 'identifieds' 4791 writer.write_start(plural) 4792 if isinstance(objs, List): 4793 href = objs.href 4794 if href is not None: 4795 writer.write_attribute('href', href) 4796 for obj in objs: 4797 IdentifiedWriter.write_one(obj, writer, singular) 4798 writer.write_end()
4801class ImageWriter(Writer): 4802 4803 def __init__(self): 4804 super(ImageWriter, self).__init__() 4805 4806 @staticmethod 4807 def write_one(obj, writer, singular=None): 4808 if singular is None: 4809 singular = 'image' 4810 writer.write_start(singular) 4811 href = obj.href 4812 if href is not None: 4813 writer.write_attribute('href', href) 4814 if obj.id is not None: 4815 writer.write_attribute('id', obj.id) 4816 if obj.comment is not None: 4817 Writer.write_string(writer, 'comment', obj.comment) 4818 if obj.description is not None: 4819 Writer.write_string(writer, 'description', obj.description) 4820 if obj.name is not None: 4821 Writer.write_string(writer, 'name', obj.name) 4822 if obj.size is not None: 4823 Writer.write_integer(writer, 'size', obj.size) 4824 if obj.type is not None: 4825 Writer.write_string(writer, 'type', obj.type.value) 4826 if obj.storage_domain is not None: 4827 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 4828 writer.write_end() 4829 4830 @staticmethod 4831 def write_many(objs, writer, singular=None, plural=None): 4832 if singular is None: 4833 singular = 'image' 4834 if plural is None: 4835 plural = 'images' 4836 writer.write_start(plural) 4837 if isinstance(objs, List): 4838 href = objs.href 4839 if href is not None: 4840 writer.write_attribute('href', href) 4841 for obj in objs: 4842 ImageWriter.write_one(obj, writer, singular) 4843 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4806 @staticmethod 4807 def write_one(obj, writer, singular=None): 4808 if singular is None: 4809 singular = 'image' 4810 writer.write_start(singular) 4811 href = obj.href 4812 if href is not None: 4813 writer.write_attribute('href', href) 4814 if obj.id is not None: 4815 writer.write_attribute('id', obj.id) 4816 if obj.comment is not None: 4817 Writer.write_string(writer, 'comment', obj.comment) 4818 if obj.description is not None: 4819 Writer.write_string(writer, 'description', obj.description) 4820 if obj.name is not None: 4821 Writer.write_string(writer, 'name', obj.name) 4822 if obj.size is not None: 4823 Writer.write_integer(writer, 'size', obj.size) 4824 if obj.type is not None: 4825 Writer.write_string(writer, 'type', obj.type.value) 4826 if obj.storage_domain is not None: 4827 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 4828 writer.write_end()
4830 @staticmethod 4831 def write_many(objs, writer, singular=None, plural=None): 4832 if singular is None: 4833 singular = 'image' 4834 if plural is None: 4835 plural = 'images' 4836 writer.write_start(plural) 4837 if isinstance(objs, List): 4838 href = objs.href 4839 if href is not None: 4840 writer.write_attribute('href', href) 4841 for obj in objs: 4842 ImageWriter.write_one(obj, writer, singular) 4843 writer.write_end()
4846class ImageTransferWriter(Writer): 4847 4848 def __init__(self): 4849 super(ImageTransferWriter, self).__init__() 4850 4851 @staticmethod 4852 def write_one(obj, writer, singular=None): 4853 if singular is None: 4854 singular = 'image_transfer' 4855 writer.write_start(singular) 4856 href = obj.href 4857 if href is not None: 4858 writer.write_attribute('href', href) 4859 if obj.id is not None: 4860 writer.write_attribute('id', obj.id) 4861 if obj.active is not None: 4862 Writer.write_boolean(writer, 'active', obj.active) 4863 if obj.comment is not None: 4864 Writer.write_string(writer, 'comment', obj.comment) 4865 if obj.description is not None: 4866 Writer.write_string(writer, 'description', obj.description) 4867 if obj.direction is not None: 4868 Writer.write_string(writer, 'direction', obj.direction.value) 4869 if obj.format is not None: 4870 Writer.write_string(writer, 'format', obj.format.value) 4871 if obj.inactivity_timeout is not None: 4872 Writer.write_integer(writer, 'inactivity_timeout', obj.inactivity_timeout) 4873 if obj.name is not None: 4874 Writer.write_string(writer, 'name', obj.name) 4875 if obj.phase is not None: 4876 Writer.write_string(writer, 'phase', obj.phase.value) 4877 if obj.proxy_url is not None: 4878 Writer.write_string(writer, 'proxy_url', obj.proxy_url) 4879 if obj.shallow is not None: 4880 Writer.write_boolean(writer, 'shallow', obj.shallow) 4881 if obj.timeout_policy is not None: 4882 Writer.write_string(writer, 'timeout_policy', obj.timeout_policy.value) 4883 if obj.transfer_url is not None: 4884 Writer.write_string(writer, 'transfer_url', obj.transfer_url) 4885 if obj.transferred is not None: 4886 Writer.write_integer(writer, 'transferred', obj.transferred) 4887 if obj.backup is not None: 4888 BackupWriter.write_one(obj.backup, writer, 'backup') 4889 if obj.disk is not None: 4890 DiskWriter.write_one(obj.disk, writer, 'disk') 4891 if obj.host is not None: 4892 HostWriter.write_one(obj.host, writer, 'host') 4893 if obj.image is not None: 4894 ImageWriter.write_one(obj.image, writer, 'image') 4895 if obj.snapshot is not None: 4896 DiskSnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 4897 writer.write_end() 4898 4899 @staticmethod 4900 def write_many(objs, writer, singular=None, plural=None): 4901 if singular is None: 4902 singular = 'image_transfer' 4903 if plural is None: 4904 plural = 'image_transfers' 4905 writer.write_start(plural) 4906 if isinstance(objs, List): 4907 href = objs.href 4908 if href is not None: 4909 writer.write_attribute('href', href) 4910 for obj in objs: 4911 ImageTransferWriter.write_one(obj, writer, singular) 4912 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4851 @staticmethod 4852 def write_one(obj, writer, singular=None): 4853 if singular is None: 4854 singular = 'image_transfer' 4855 writer.write_start(singular) 4856 href = obj.href 4857 if href is not None: 4858 writer.write_attribute('href', href) 4859 if obj.id is not None: 4860 writer.write_attribute('id', obj.id) 4861 if obj.active is not None: 4862 Writer.write_boolean(writer, 'active', obj.active) 4863 if obj.comment is not None: 4864 Writer.write_string(writer, 'comment', obj.comment) 4865 if obj.description is not None: 4866 Writer.write_string(writer, 'description', obj.description) 4867 if obj.direction is not None: 4868 Writer.write_string(writer, 'direction', obj.direction.value) 4869 if obj.format is not None: 4870 Writer.write_string(writer, 'format', obj.format.value) 4871 if obj.inactivity_timeout is not None: 4872 Writer.write_integer(writer, 'inactivity_timeout', obj.inactivity_timeout) 4873 if obj.name is not None: 4874 Writer.write_string(writer, 'name', obj.name) 4875 if obj.phase is not None: 4876 Writer.write_string(writer, 'phase', obj.phase.value) 4877 if obj.proxy_url is not None: 4878 Writer.write_string(writer, 'proxy_url', obj.proxy_url) 4879 if obj.shallow is not None: 4880 Writer.write_boolean(writer, 'shallow', obj.shallow) 4881 if obj.timeout_policy is not None: 4882 Writer.write_string(writer, 'timeout_policy', obj.timeout_policy.value) 4883 if obj.transfer_url is not None: 4884 Writer.write_string(writer, 'transfer_url', obj.transfer_url) 4885 if obj.transferred is not None: 4886 Writer.write_integer(writer, 'transferred', obj.transferred) 4887 if obj.backup is not None: 4888 BackupWriter.write_one(obj.backup, writer, 'backup') 4889 if obj.disk is not None: 4890 DiskWriter.write_one(obj.disk, writer, 'disk') 4891 if obj.host is not None: 4892 HostWriter.write_one(obj.host, writer, 'host') 4893 if obj.image is not None: 4894 ImageWriter.write_one(obj.image, writer, 'image') 4895 if obj.snapshot is not None: 4896 DiskSnapshotWriter.write_one(obj.snapshot, writer, 'snapshot') 4897 writer.write_end()
4899 @staticmethod 4900 def write_many(objs, writer, singular=None, plural=None): 4901 if singular is None: 4902 singular = 'image_transfer' 4903 if plural is None: 4904 plural = 'image_transfers' 4905 writer.write_start(plural) 4906 if isinstance(objs, List): 4907 href = objs.href 4908 if href is not None: 4909 writer.write_attribute('href', href) 4910 for obj in objs: 4911 ImageTransferWriter.write_one(obj, writer, singular) 4912 writer.write_end()
4915class InitializationWriter(Writer): 4916 4917 def __init__(self): 4918 super(InitializationWriter, self).__init__() 4919 4920 @staticmethod 4921 def write_one(obj, writer, singular=None): 4922 if singular is None: 4923 singular = 'initialization' 4924 writer.write_start(singular) 4925 href = obj.href 4926 if href is not None: 4927 writer.write_attribute('href', href) 4928 if obj.active_directory_ou is not None: 4929 Writer.write_string(writer, 'active_directory_ou', obj.active_directory_ou) 4930 if obj.authorized_ssh_keys is not None: 4931 Writer.write_string(writer, 'authorized_ssh_keys', obj.authorized_ssh_keys) 4932 if obj.cloud_init is not None: 4933 CloudInitWriter.write_one(obj.cloud_init, writer, 'cloud_init') 4934 if obj.cloud_init_network_protocol is not None: 4935 Writer.write_string(writer, 'cloud_init_network_protocol', obj.cloud_init_network_protocol.value) 4936 if obj.configuration is not None: 4937 ConfigurationWriter.write_one(obj.configuration, writer, 'configuration') 4938 if obj.custom_script is not None: 4939 Writer.write_string(writer, 'custom_script', obj.custom_script) 4940 if obj.dns_search is not None: 4941 Writer.write_string(writer, 'dns_search', obj.dns_search) 4942 if obj.dns_servers is not None: 4943 Writer.write_string(writer, 'dns_servers', obj.dns_servers) 4944 if obj.domain is not None: 4945 Writer.write_string(writer, 'domain', obj.domain) 4946 if obj.host_name is not None: 4947 Writer.write_string(writer, 'host_name', obj.host_name) 4948 if obj.input_locale is not None: 4949 Writer.write_string(writer, 'input_locale', obj.input_locale) 4950 if obj.nic_configurations is not None: 4951 NicConfigurationWriter.write_many(obj.nic_configurations, writer, 'nic_configuration', 'nic_configurations') 4952 if obj.org_name is not None: 4953 Writer.write_string(writer, 'org_name', obj.org_name) 4954 if obj.regenerate_ids is not None: 4955 Writer.write_boolean(writer, 'regenerate_ids', obj.regenerate_ids) 4956 if obj.regenerate_ssh_keys is not None: 4957 Writer.write_boolean(writer, 'regenerate_ssh_keys', obj.regenerate_ssh_keys) 4958 if obj.root_password is not None: 4959 Writer.write_string(writer, 'root_password', obj.root_password) 4960 if obj.system_locale is not None: 4961 Writer.write_string(writer, 'system_locale', obj.system_locale) 4962 if obj.timezone is not None: 4963 Writer.write_string(writer, 'timezone', obj.timezone) 4964 if obj.ui_language is not None: 4965 Writer.write_string(writer, 'ui_language', obj.ui_language) 4966 if obj.user_locale is not None: 4967 Writer.write_string(writer, 'user_locale', obj.user_locale) 4968 if obj.user_name is not None: 4969 Writer.write_string(writer, 'user_name', obj.user_name) 4970 if obj.windows_license_key is not None: 4971 Writer.write_string(writer, 'windows_license_key', obj.windows_license_key) 4972 writer.write_end() 4973 4974 @staticmethod 4975 def write_many(objs, writer, singular=None, plural=None): 4976 if singular is None: 4977 singular = 'initialization' 4978 if plural is None: 4979 plural = 'initializations' 4980 writer.write_start(plural) 4981 if isinstance(objs, List): 4982 href = objs.href 4983 if href is not None: 4984 writer.write_attribute('href', href) 4985 for obj in objs: 4986 InitializationWriter.write_one(obj, writer, singular) 4987 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4920 @staticmethod 4921 def write_one(obj, writer, singular=None): 4922 if singular is None: 4923 singular = 'initialization' 4924 writer.write_start(singular) 4925 href = obj.href 4926 if href is not None: 4927 writer.write_attribute('href', href) 4928 if obj.active_directory_ou is not None: 4929 Writer.write_string(writer, 'active_directory_ou', obj.active_directory_ou) 4930 if obj.authorized_ssh_keys is not None: 4931 Writer.write_string(writer, 'authorized_ssh_keys', obj.authorized_ssh_keys) 4932 if obj.cloud_init is not None: 4933 CloudInitWriter.write_one(obj.cloud_init, writer, 'cloud_init') 4934 if obj.cloud_init_network_protocol is not None: 4935 Writer.write_string(writer, 'cloud_init_network_protocol', obj.cloud_init_network_protocol.value) 4936 if obj.configuration is not None: 4937 ConfigurationWriter.write_one(obj.configuration, writer, 'configuration') 4938 if obj.custom_script is not None: 4939 Writer.write_string(writer, 'custom_script', obj.custom_script) 4940 if obj.dns_search is not None: 4941 Writer.write_string(writer, 'dns_search', obj.dns_search) 4942 if obj.dns_servers is not None: 4943 Writer.write_string(writer, 'dns_servers', obj.dns_servers) 4944 if obj.domain is not None: 4945 Writer.write_string(writer, 'domain', obj.domain) 4946 if obj.host_name is not None: 4947 Writer.write_string(writer, 'host_name', obj.host_name) 4948 if obj.input_locale is not None: 4949 Writer.write_string(writer, 'input_locale', obj.input_locale) 4950 if obj.nic_configurations is not None: 4951 NicConfigurationWriter.write_many(obj.nic_configurations, writer, 'nic_configuration', 'nic_configurations') 4952 if obj.org_name is not None: 4953 Writer.write_string(writer, 'org_name', obj.org_name) 4954 if obj.regenerate_ids is not None: 4955 Writer.write_boolean(writer, 'regenerate_ids', obj.regenerate_ids) 4956 if obj.regenerate_ssh_keys is not None: 4957 Writer.write_boolean(writer, 'regenerate_ssh_keys', obj.regenerate_ssh_keys) 4958 if obj.root_password is not None: 4959 Writer.write_string(writer, 'root_password', obj.root_password) 4960 if obj.system_locale is not None: 4961 Writer.write_string(writer, 'system_locale', obj.system_locale) 4962 if obj.timezone is not None: 4963 Writer.write_string(writer, 'timezone', obj.timezone) 4964 if obj.ui_language is not None: 4965 Writer.write_string(writer, 'ui_language', obj.ui_language) 4966 if obj.user_locale is not None: 4967 Writer.write_string(writer, 'user_locale', obj.user_locale) 4968 if obj.user_name is not None: 4969 Writer.write_string(writer, 'user_name', obj.user_name) 4970 if obj.windows_license_key is not None: 4971 Writer.write_string(writer, 'windows_license_key', obj.windows_license_key) 4972 writer.write_end()
4974 @staticmethod 4975 def write_many(objs, writer, singular=None, plural=None): 4976 if singular is None: 4977 singular = 'initialization' 4978 if plural is None: 4979 plural = 'initializations' 4980 writer.write_start(plural) 4981 if isinstance(objs, List): 4982 href = objs.href 4983 if href is not None: 4984 writer.write_attribute('href', href) 4985 for obj in objs: 4986 InitializationWriter.write_one(obj, writer, singular) 4987 writer.write_end()
4990class InstanceTypeWriter(Writer): 4991 4992 def __init__(self): 4993 super(InstanceTypeWriter, self).__init__() 4994 4995 @staticmethod 4996 def write_one(obj, writer, singular=None): 4997 if singular is None: 4998 singular = 'instance_type' 4999 writer.write_start(singular) 5000 href = obj.href 5001 if href is not None: 5002 writer.write_attribute('href', href) 5003 if obj.id is not None: 5004 writer.write_attribute('id', obj.id) 5005 if obj.auto_pinning_policy is not None: 5006 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 5007 if obj.bios is not None: 5008 BiosWriter.write_one(obj.bios, writer, 'bios') 5009 if obj.comment is not None: 5010 Writer.write_string(writer, 'comment', obj.comment) 5011 if obj.console is not None: 5012 ConsoleWriter.write_one(obj.console, writer, 'console') 5013 if obj.cpu is not None: 5014 CpuWriter.write_one(obj.cpu, writer, 'cpu') 5015 if obj.cpu_pinning_policy is not None: 5016 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 5017 if obj.cpu_shares is not None: 5018 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 5019 if obj.creation_time is not None: 5020 Writer.write_date(writer, 'creation_time', obj.creation_time) 5021 if obj.custom_compatibility_version is not None: 5022 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 5023 if obj.custom_cpu_model is not None: 5024 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 5025 if obj.custom_emulated_machine is not None: 5026 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 5027 if obj.custom_properties is not None: 5028 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 5029 if obj.delete_protected is not None: 5030 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 5031 if obj.description is not None: 5032 Writer.write_string(writer, 'description', obj.description) 5033 if obj.display is not None: 5034 DisplayWriter.write_one(obj.display, writer, 'display') 5035 if obj.domain is not None: 5036 DomainWriter.write_one(obj.domain, writer, 'domain') 5037 if obj.high_availability is not None: 5038 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 5039 if obj.initialization is not None: 5040 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 5041 if obj.io is not None: 5042 IoWriter.write_one(obj.io, writer, 'io') 5043 if obj.large_icon is not None: 5044 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 5045 if obj.lease is not None: 5046 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 5047 if obj.memory is not None: 5048 Writer.write_integer(writer, 'memory', obj.memory) 5049 if obj.memory_policy is not None: 5050 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 5051 if obj.migration is not None: 5052 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 5053 if obj.migration_downtime is not None: 5054 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 5055 if obj.multi_queues_enabled is not None: 5056 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 5057 if obj.name is not None: 5058 Writer.write_string(writer, 'name', obj.name) 5059 if obj.origin is not None: 5060 Writer.write_string(writer, 'origin', obj.origin) 5061 if obj.os is not None: 5062 OperatingSystemWriter.write_one(obj.os, writer, 'os') 5063 if obj.placement_policy is not None: 5064 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 5065 if obj.rng_device is not None: 5066 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 5067 if obj.serial_number is not None: 5068 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 5069 if obj.small_icon is not None: 5070 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 5071 if obj.soundcard_enabled is not None: 5072 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 5073 if obj.sso is not None: 5074 SsoWriter.write_one(obj.sso, writer, 'sso') 5075 if obj.start_paused is not None: 5076 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 5077 if obj.stateless is not None: 5078 Writer.write_boolean(writer, 'stateless', obj.stateless) 5079 if obj.status is not None: 5080 Writer.write_string(writer, 'status', obj.status.value) 5081 if obj.storage_error_resume_behaviour is not None: 5082 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 5083 if obj.time_zone is not None: 5084 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 5085 if obj.tpm_enabled is not None: 5086 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 5087 if obj.tunnel_migration is not None: 5088 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 5089 if obj.type is not None: 5090 Writer.write_string(writer, 'type', obj.type.value) 5091 if obj.usb is not None: 5092 UsbWriter.write_one(obj.usb, writer, 'usb') 5093 if obj.version is not None: 5094 TemplateVersionWriter.write_one(obj.version, writer, 'version') 5095 if obj.virtio_scsi is not None: 5096 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 5097 if obj.virtio_scsi_multi_queues is not None: 5098 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 5099 if obj.virtio_scsi_multi_queues_enabled is not None: 5100 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 5101 if obj.vm is not None: 5102 VmWriter.write_one(obj.vm, writer, 'vm') 5103 if obj.cdroms is not None: 5104 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 5105 if obj.cluster is not None: 5106 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 5107 if obj.cpu_profile is not None: 5108 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 5109 if obj.disk_attachments is not None: 5110 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 5111 if obj.graphics_consoles is not None: 5112 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 5113 if obj.mediated_devices is not None: 5114 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 5115 if obj.nics is not None: 5116 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 5117 if obj.permissions is not None: 5118 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 5119 if obj.quota is not None: 5120 QuotaWriter.write_one(obj.quota, writer, 'quota') 5121 if obj.storage_domain is not None: 5122 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 5123 if obj.tags is not None: 5124 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 5125 if obj.watchdogs is not None: 5126 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 5127 writer.write_end() 5128 5129 @staticmethod 5130 def write_many(objs, writer, singular=None, plural=None): 5131 if singular is None: 5132 singular = 'instance_type' 5133 if plural is None: 5134 plural = 'instance_types' 5135 writer.write_start(plural) 5136 if isinstance(objs, List): 5137 href = objs.href 5138 if href is not None: 5139 writer.write_attribute('href', href) 5140 for obj in objs: 5141 InstanceTypeWriter.write_one(obj, writer, singular) 5142 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
4995 @staticmethod 4996 def write_one(obj, writer, singular=None): 4997 if singular is None: 4998 singular = 'instance_type' 4999 writer.write_start(singular) 5000 href = obj.href 5001 if href is not None: 5002 writer.write_attribute('href', href) 5003 if obj.id is not None: 5004 writer.write_attribute('id', obj.id) 5005 if obj.auto_pinning_policy is not None: 5006 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 5007 if obj.bios is not None: 5008 BiosWriter.write_one(obj.bios, writer, 'bios') 5009 if obj.comment is not None: 5010 Writer.write_string(writer, 'comment', obj.comment) 5011 if obj.console is not None: 5012 ConsoleWriter.write_one(obj.console, writer, 'console') 5013 if obj.cpu is not None: 5014 CpuWriter.write_one(obj.cpu, writer, 'cpu') 5015 if obj.cpu_pinning_policy is not None: 5016 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 5017 if obj.cpu_shares is not None: 5018 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 5019 if obj.creation_time is not None: 5020 Writer.write_date(writer, 'creation_time', obj.creation_time) 5021 if obj.custom_compatibility_version is not None: 5022 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 5023 if obj.custom_cpu_model is not None: 5024 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 5025 if obj.custom_emulated_machine is not None: 5026 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 5027 if obj.custom_properties is not None: 5028 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 5029 if obj.delete_protected is not None: 5030 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 5031 if obj.description is not None: 5032 Writer.write_string(writer, 'description', obj.description) 5033 if obj.display is not None: 5034 DisplayWriter.write_one(obj.display, writer, 'display') 5035 if obj.domain is not None: 5036 DomainWriter.write_one(obj.domain, writer, 'domain') 5037 if obj.high_availability is not None: 5038 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 5039 if obj.initialization is not None: 5040 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 5041 if obj.io is not None: 5042 IoWriter.write_one(obj.io, writer, 'io') 5043 if obj.large_icon is not None: 5044 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 5045 if obj.lease is not None: 5046 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 5047 if obj.memory is not None: 5048 Writer.write_integer(writer, 'memory', obj.memory) 5049 if obj.memory_policy is not None: 5050 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 5051 if obj.migration is not None: 5052 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 5053 if obj.migration_downtime is not None: 5054 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 5055 if obj.multi_queues_enabled is not None: 5056 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 5057 if obj.name is not None: 5058 Writer.write_string(writer, 'name', obj.name) 5059 if obj.origin is not None: 5060 Writer.write_string(writer, 'origin', obj.origin) 5061 if obj.os is not None: 5062 OperatingSystemWriter.write_one(obj.os, writer, 'os') 5063 if obj.placement_policy is not None: 5064 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 5065 if obj.rng_device is not None: 5066 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 5067 if obj.serial_number is not None: 5068 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 5069 if obj.small_icon is not None: 5070 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 5071 if obj.soundcard_enabled is not None: 5072 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 5073 if obj.sso is not None: 5074 SsoWriter.write_one(obj.sso, writer, 'sso') 5075 if obj.start_paused is not None: 5076 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 5077 if obj.stateless is not None: 5078 Writer.write_boolean(writer, 'stateless', obj.stateless) 5079 if obj.status is not None: 5080 Writer.write_string(writer, 'status', obj.status.value) 5081 if obj.storage_error_resume_behaviour is not None: 5082 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 5083 if obj.time_zone is not None: 5084 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 5085 if obj.tpm_enabled is not None: 5086 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 5087 if obj.tunnel_migration is not None: 5088 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 5089 if obj.type is not None: 5090 Writer.write_string(writer, 'type', obj.type.value) 5091 if obj.usb is not None: 5092 UsbWriter.write_one(obj.usb, writer, 'usb') 5093 if obj.version is not None: 5094 TemplateVersionWriter.write_one(obj.version, writer, 'version') 5095 if obj.virtio_scsi is not None: 5096 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 5097 if obj.virtio_scsi_multi_queues is not None: 5098 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 5099 if obj.virtio_scsi_multi_queues_enabled is not None: 5100 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 5101 if obj.vm is not None: 5102 VmWriter.write_one(obj.vm, writer, 'vm') 5103 if obj.cdroms is not None: 5104 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 5105 if obj.cluster is not None: 5106 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 5107 if obj.cpu_profile is not None: 5108 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 5109 if obj.disk_attachments is not None: 5110 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 5111 if obj.graphics_consoles is not None: 5112 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 5113 if obj.mediated_devices is not None: 5114 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 5115 if obj.nics is not None: 5116 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 5117 if obj.permissions is not None: 5118 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 5119 if obj.quota is not None: 5120 QuotaWriter.write_one(obj.quota, writer, 'quota') 5121 if obj.storage_domain is not None: 5122 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 5123 if obj.tags is not None: 5124 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 5125 if obj.watchdogs is not None: 5126 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 5127 writer.write_end()
5129 @staticmethod 5130 def write_many(objs, writer, singular=None, plural=None): 5131 if singular is None: 5132 singular = 'instance_type' 5133 if plural is None: 5134 plural = 'instance_types' 5135 writer.write_start(plural) 5136 if isinstance(objs, List): 5137 href = objs.href 5138 if href is not None: 5139 writer.write_attribute('href', href) 5140 for obj in objs: 5141 InstanceTypeWriter.write_one(obj, writer, singular) 5142 writer.write_end()
5145class IoWriter(Writer): 5146 5147 def __init__(self): 5148 super(IoWriter, self).__init__() 5149 5150 @staticmethod 5151 def write_one(obj, writer, singular=None): 5152 if singular is None: 5153 singular = 'io' 5154 writer.write_start(singular) 5155 href = obj.href 5156 if href is not None: 5157 writer.write_attribute('href', href) 5158 if obj.threads is not None: 5159 Writer.write_integer(writer, 'threads', obj.threads) 5160 writer.write_end() 5161 5162 @staticmethod 5163 def write_many(objs, writer, singular=None, plural=None): 5164 if singular is None: 5165 singular = 'io' 5166 if plural is None: 5167 plural = 'ios' 5168 writer.write_start(plural) 5169 if isinstance(objs, List): 5170 href = objs.href 5171 if href is not None: 5172 writer.write_attribute('href', href) 5173 for obj in objs: 5174 IoWriter.write_one(obj, writer, singular) 5175 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5150 @staticmethod 5151 def write_one(obj, writer, singular=None): 5152 if singular is None: 5153 singular = 'io' 5154 writer.write_start(singular) 5155 href = obj.href 5156 if href is not None: 5157 writer.write_attribute('href', href) 5158 if obj.threads is not None: 5159 Writer.write_integer(writer, 'threads', obj.threads) 5160 writer.write_end()
5162 @staticmethod 5163 def write_many(objs, writer, singular=None, plural=None): 5164 if singular is None: 5165 singular = 'io' 5166 if plural is None: 5167 plural = 'ios' 5168 writer.write_start(plural) 5169 if isinstance(objs, List): 5170 href = objs.href 5171 if href is not None: 5172 writer.write_attribute('href', href) 5173 for obj in objs: 5174 IoWriter.write_one(obj, writer, singular) 5175 writer.write_end()
5178class IpWriter(Writer): 5179 5180 def __init__(self): 5181 super(IpWriter, self).__init__() 5182 5183 @staticmethod 5184 def write_one(obj, writer, singular=None): 5185 if singular is None: 5186 singular = 'ip' 5187 writer.write_start(singular) 5188 href = obj.href 5189 if href is not None: 5190 writer.write_attribute('href', href) 5191 if obj.address is not None: 5192 Writer.write_string(writer, 'address', obj.address) 5193 if obj.gateway is not None: 5194 Writer.write_string(writer, 'gateway', obj.gateway) 5195 if obj.netmask is not None: 5196 Writer.write_string(writer, 'netmask', obj.netmask) 5197 if obj.version is not None: 5198 Writer.write_string(writer, 'version', obj.version.value) 5199 writer.write_end() 5200 5201 @staticmethod 5202 def write_many(objs, writer, singular=None, plural=None): 5203 if singular is None: 5204 singular = 'ip' 5205 if plural is None: 5206 plural = 'ips' 5207 writer.write_start(plural) 5208 if isinstance(objs, List): 5209 href = objs.href 5210 if href is not None: 5211 writer.write_attribute('href', href) 5212 for obj in objs: 5213 IpWriter.write_one(obj, writer, singular) 5214 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5183 @staticmethod 5184 def write_one(obj, writer, singular=None): 5185 if singular is None: 5186 singular = 'ip' 5187 writer.write_start(singular) 5188 href = obj.href 5189 if href is not None: 5190 writer.write_attribute('href', href) 5191 if obj.address is not None: 5192 Writer.write_string(writer, 'address', obj.address) 5193 if obj.gateway is not None: 5194 Writer.write_string(writer, 'gateway', obj.gateway) 5195 if obj.netmask is not None: 5196 Writer.write_string(writer, 'netmask', obj.netmask) 5197 if obj.version is not None: 5198 Writer.write_string(writer, 'version', obj.version.value) 5199 writer.write_end()
5201 @staticmethod 5202 def write_many(objs, writer, singular=None, plural=None): 5203 if singular is None: 5204 singular = 'ip' 5205 if plural is None: 5206 plural = 'ips' 5207 writer.write_start(plural) 5208 if isinstance(objs, List): 5209 href = objs.href 5210 if href is not None: 5211 writer.write_attribute('href', href) 5212 for obj in objs: 5213 IpWriter.write_one(obj, writer, singular) 5214 writer.write_end()
5217class IpAddressAssignmentWriter(Writer): 5218 5219 def __init__(self): 5220 super(IpAddressAssignmentWriter, self).__init__() 5221 5222 @staticmethod 5223 def write_one(obj, writer, singular=None): 5224 if singular is None: 5225 singular = 'ip_address_assignment' 5226 writer.write_start(singular) 5227 href = obj.href 5228 if href is not None: 5229 writer.write_attribute('href', href) 5230 if obj.assignment_method is not None: 5231 Writer.write_string(writer, 'assignment_method', obj.assignment_method.value) 5232 if obj.ip is not None: 5233 IpWriter.write_one(obj.ip, writer, 'ip') 5234 writer.write_end() 5235 5236 @staticmethod 5237 def write_many(objs, writer, singular=None, plural=None): 5238 if singular is None: 5239 singular = 'ip_address_assignment' 5240 if plural is None: 5241 plural = 'ip_address_assignments' 5242 writer.write_start(plural) 5243 if isinstance(objs, List): 5244 href = objs.href 5245 if href is not None: 5246 writer.write_attribute('href', href) 5247 for obj in objs: 5248 IpAddressAssignmentWriter.write_one(obj, writer, singular) 5249 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5222 @staticmethod 5223 def write_one(obj, writer, singular=None): 5224 if singular is None: 5225 singular = 'ip_address_assignment' 5226 writer.write_start(singular) 5227 href = obj.href 5228 if href is not None: 5229 writer.write_attribute('href', href) 5230 if obj.assignment_method is not None: 5231 Writer.write_string(writer, 'assignment_method', obj.assignment_method.value) 5232 if obj.ip is not None: 5233 IpWriter.write_one(obj.ip, writer, 'ip') 5234 writer.write_end()
5236 @staticmethod 5237 def write_many(objs, writer, singular=None, plural=None): 5238 if singular is None: 5239 singular = 'ip_address_assignment' 5240 if plural is None: 5241 plural = 'ip_address_assignments' 5242 writer.write_start(plural) 5243 if isinstance(objs, List): 5244 href = objs.href 5245 if href is not None: 5246 writer.write_attribute('href', href) 5247 for obj in objs: 5248 IpAddressAssignmentWriter.write_one(obj, writer, singular) 5249 writer.write_end()
5252class IscsiBondWriter(Writer): 5253 5254 def __init__(self): 5255 super(IscsiBondWriter, self).__init__() 5256 5257 @staticmethod 5258 def write_one(obj, writer, singular=None): 5259 if singular is None: 5260 singular = 'iscsi_bond' 5261 writer.write_start(singular) 5262 href = obj.href 5263 if href is not None: 5264 writer.write_attribute('href', href) 5265 if obj.id is not None: 5266 writer.write_attribute('id', obj.id) 5267 if obj.comment is not None: 5268 Writer.write_string(writer, 'comment', obj.comment) 5269 if obj.description is not None: 5270 Writer.write_string(writer, 'description', obj.description) 5271 if obj.name is not None: 5272 Writer.write_string(writer, 'name', obj.name) 5273 if obj.data_center is not None: 5274 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 5275 if obj.networks is not None: 5276 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 5277 if obj.storage_connections is not None: 5278 StorageConnectionWriter.write_many(obj.storage_connections, writer, 'storage_connection', 'storage_connections') 5279 writer.write_end() 5280 5281 @staticmethod 5282 def write_many(objs, writer, singular=None, plural=None): 5283 if singular is None: 5284 singular = 'iscsi_bond' 5285 if plural is None: 5286 plural = 'iscsi_bonds' 5287 writer.write_start(plural) 5288 if isinstance(objs, List): 5289 href = objs.href 5290 if href is not None: 5291 writer.write_attribute('href', href) 5292 for obj in objs: 5293 IscsiBondWriter.write_one(obj, writer, singular) 5294 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5257 @staticmethod 5258 def write_one(obj, writer, singular=None): 5259 if singular is None: 5260 singular = 'iscsi_bond' 5261 writer.write_start(singular) 5262 href = obj.href 5263 if href is not None: 5264 writer.write_attribute('href', href) 5265 if obj.id is not None: 5266 writer.write_attribute('id', obj.id) 5267 if obj.comment is not None: 5268 Writer.write_string(writer, 'comment', obj.comment) 5269 if obj.description is not None: 5270 Writer.write_string(writer, 'description', obj.description) 5271 if obj.name is not None: 5272 Writer.write_string(writer, 'name', obj.name) 5273 if obj.data_center is not None: 5274 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 5275 if obj.networks is not None: 5276 NetworkWriter.write_many(obj.networks, writer, 'network', 'networks') 5277 if obj.storage_connections is not None: 5278 StorageConnectionWriter.write_many(obj.storage_connections, writer, 'storage_connection', 'storage_connections') 5279 writer.write_end()
5281 @staticmethod 5282 def write_many(objs, writer, singular=None, plural=None): 5283 if singular is None: 5284 singular = 'iscsi_bond' 5285 if plural is None: 5286 plural = 'iscsi_bonds' 5287 writer.write_start(plural) 5288 if isinstance(objs, List): 5289 href = objs.href 5290 if href is not None: 5291 writer.write_attribute('href', href) 5292 for obj in objs: 5293 IscsiBondWriter.write_one(obj, writer, singular) 5294 writer.write_end()
5297class IscsiDetailsWriter(Writer): 5298 5299 def __init__(self): 5300 super(IscsiDetailsWriter, self).__init__() 5301 5302 @staticmethod 5303 def write_one(obj, writer, singular=None): 5304 if singular is None: 5305 singular = 'iscsi_details' 5306 writer.write_start(singular) 5307 href = obj.href 5308 if href is not None: 5309 writer.write_attribute('href', href) 5310 if obj.address is not None: 5311 Writer.write_string(writer, 'address', obj.address) 5312 if obj.disk_id is not None: 5313 Writer.write_string(writer, 'disk_id', obj.disk_id) 5314 if obj.initiator is not None: 5315 Writer.write_string(writer, 'initiator', obj.initiator) 5316 if obj.lun_mapping is not None: 5317 Writer.write_integer(writer, 'lun_mapping', obj.lun_mapping) 5318 if obj.password is not None: 5319 Writer.write_string(writer, 'password', obj.password) 5320 if obj.paths is not None: 5321 Writer.write_integer(writer, 'paths', obj.paths) 5322 if obj.port is not None: 5323 Writer.write_integer(writer, 'port', obj.port) 5324 if obj.portal is not None: 5325 Writer.write_string(writer, 'portal', obj.portal) 5326 if obj.product_id is not None: 5327 Writer.write_string(writer, 'product_id', obj.product_id) 5328 if obj.serial is not None: 5329 Writer.write_string(writer, 'serial', obj.serial) 5330 if obj.size is not None: 5331 Writer.write_integer(writer, 'size', obj.size) 5332 if obj.status is not None: 5333 Writer.write_string(writer, 'status', obj.status) 5334 if obj.storage_domain_id is not None: 5335 Writer.write_string(writer, 'storage_domain_id', obj.storage_domain_id) 5336 if obj.target is not None: 5337 Writer.write_string(writer, 'target', obj.target) 5338 if obj.username is not None: 5339 Writer.write_string(writer, 'username', obj.username) 5340 if obj.vendor_id is not None: 5341 Writer.write_string(writer, 'vendor_id', obj.vendor_id) 5342 if obj.volume_group_id is not None: 5343 Writer.write_string(writer, 'volume_group_id', obj.volume_group_id) 5344 writer.write_end() 5345 5346 @staticmethod 5347 def write_many(objs, writer, singular=None, plural=None): 5348 if singular is None: 5349 singular = 'iscsi_details' 5350 if plural is None: 5351 plural = 'iscsi_detailss' 5352 writer.write_start(plural) 5353 if isinstance(objs, List): 5354 href = objs.href 5355 if href is not None: 5356 writer.write_attribute('href', href) 5357 for obj in objs: 5358 IscsiDetailsWriter.write_one(obj, writer, singular) 5359 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5302 @staticmethod 5303 def write_one(obj, writer, singular=None): 5304 if singular is None: 5305 singular = 'iscsi_details' 5306 writer.write_start(singular) 5307 href = obj.href 5308 if href is not None: 5309 writer.write_attribute('href', href) 5310 if obj.address is not None: 5311 Writer.write_string(writer, 'address', obj.address) 5312 if obj.disk_id is not None: 5313 Writer.write_string(writer, 'disk_id', obj.disk_id) 5314 if obj.initiator is not None: 5315 Writer.write_string(writer, 'initiator', obj.initiator) 5316 if obj.lun_mapping is not None: 5317 Writer.write_integer(writer, 'lun_mapping', obj.lun_mapping) 5318 if obj.password is not None: 5319 Writer.write_string(writer, 'password', obj.password) 5320 if obj.paths is not None: 5321 Writer.write_integer(writer, 'paths', obj.paths) 5322 if obj.port is not None: 5323 Writer.write_integer(writer, 'port', obj.port) 5324 if obj.portal is not None: 5325 Writer.write_string(writer, 'portal', obj.portal) 5326 if obj.product_id is not None: 5327 Writer.write_string(writer, 'product_id', obj.product_id) 5328 if obj.serial is not None: 5329 Writer.write_string(writer, 'serial', obj.serial) 5330 if obj.size is not None: 5331 Writer.write_integer(writer, 'size', obj.size) 5332 if obj.status is not None: 5333 Writer.write_string(writer, 'status', obj.status) 5334 if obj.storage_domain_id is not None: 5335 Writer.write_string(writer, 'storage_domain_id', obj.storage_domain_id) 5336 if obj.target is not None: 5337 Writer.write_string(writer, 'target', obj.target) 5338 if obj.username is not None: 5339 Writer.write_string(writer, 'username', obj.username) 5340 if obj.vendor_id is not None: 5341 Writer.write_string(writer, 'vendor_id', obj.vendor_id) 5342 if obj.volume_group_id is not None: 5343 Writer.write_string(writer, 'volume_group_id', obj.volume_group_id) 5344 writer.write_end()
5346 @staticmethod 5347 def write_many(objs, writer, singular=None, plural=None): 5348 if singular is None: 5349 singular = 'iscsi_details' 5350 if plural is None: 5351 plural = 'iscsi_detailss' 5352 writer.write_start(plural) 5353 if isinstance(objs, List): 5354 href = objs.href 5355 if href is not None: 5356 writer.write_attribute('href', href) 5357 for obj in objs: 5358 IscsiDetailsWriter.write_one(obj, writer, singular) 5359 writer.write_end()
5362class JobWriter(Writer): 5363 5364 def __init__(self): 5365 super(JobWriter, self).__init__() 5366 5367 @staticmethod 5368 def write_one(obj, writer, singular=None): 5369 if singular is None: 5370 singular = 'job' 5371 writer.write_start(singular) 5372 href = obj.href 5373 if href is not None: 5374 writer.write_attribute('href', href) 5375 if obj.id is not None: 5376 writer.write_attribute('id', obj.id) 5377 if obj.auto_cleared is not None: 5378 Writer.write_boolean(writer, 'auto_cleared', obj.auto_cleared) 5379 if obj.comment is not None: 5380 Writer.write_string(writer, 'comment', obj.comment) 5381 if obj.description is not None: 5382 Writer.write_string(writer, 'description', obj.description) 5383 if obj.end_time is not None: 5384 Writer.write_date(writer, 'end_time', obj.end_time) 5385 if obj.external is not None: 5386 Writer.write_boolean(writer, 'external', obj.external) 5387 if obj.last_updated is not None: 5388 Writer.write_date(writer, 'last_updated', obj.last_updated) 5389 if obj.name is not None: 5390 Writer.write_string(writer, 'name', obj.name) 5391 if obj.start_time is not None: 5392 Writer.write_date(writer, 'start_time', obj.start_time) 5393 if obj.status is not None: 5394 Writer.write_string(writer, 'status', obj.status.value) 5395 if obj.owner is not None: 5396 UserWriter.write_one(obj.owner, writer, 'owner') 5397 if obj.steps is not None: 5398 StepWriter.write_many(obj.steps, writer, 'step', 'steps') 5399 writer.write_end() 5400 5401 @staticmethod 5402 def write_many(objs, writer, singular=None, plural=None): 5403 if singular is None: 5404 singular = 'job' 5405 if plural is None: 5406 plural = 'jobs' 5407 writer.write_start(plural) 5408 if isinstance(objs, List): 5409 href = objs.href 5410 if href is not None: 5411 writer.write_attribute('href', href) 5412 for obj in objs: 5413 JobWriter.write_one(obj, writer, singular) 5414 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5367 @staticmethod 5368 def write_one(obj, writer, singular=None): 5369 if singular is None: 5370 singular = 'job' 5371 writer.write_start(singular) 5372 href = obj.href 5373 if href is not None: 5374 writer.write_attribute('href', href) 5375 if obj.id is not None: 5376 writer.write_attribute('id', obj.id) 5377 if obj.auto_cleared is not None: 5378 Writer.write_boolean(writer, 'auto_cleared', obj.auto_cleared) 5379 if obj.comment is not None: 5380 Writer.write_string(writer, 'comment', obj.comment) 5381 if obj.description is not None: 5382 Writer.write_string(writer, 'description', obj.description) 5383 if obj.end_time is not None: 5384 Writer.write_date(writer, 'end_time', obj.end_time) 5385 if obj.external is not None: 5386 Writer.write_boolean(writer, 'external', obj.external) 5387 if obj.last_updated is not None: 5388 Writer.write_date(writer, 'last_updated', obj.last_updated) 5389 if obj.name is not None: 5390 Writer.write_string(writer, 'name', obj.name) 5391 if obj.start_time is not None: 5392 Writer.write_date(writer, 'start_time', obj.start_time) 5393 if obj.status is not None: 5394 Writer.write_string(writer, 'status', obj.status.value) 5395 if obj.owner is not None: 5396 UserWriter.write_one(obj.owner, writer, 'owner') 5397 if obj.steps is not None: 5398 StepWriter.write_many(obj.steps, writer, 'step', 'steps') 5399 writer.write_end()
5401 @staticmethod 5402 def write_many(objs, writer, singular=None, plural=None): 5403 if singular is None: 5404 singular = 'job' 5405 if plural is None: 5406 plural = 'jobs' 5407 writer.write_start(plural) 5408 if isinstance(objs, List): 5409 href = objs.href 5410 if href is not None: 5411 writer.write_attribute('href', href) 5412 for obj in objs: 5413 JobWriter.write_one(obj, writer, singular) 5414 writer.write_end()
5417class KatelloErratumWriter(Writer): 5418 5419 def __init__(self): 5420 super(KatelloErratumWriter, self).__init__() 5421 5422 @staticmethod 5423 def write_one(obj, writer, singular=None): 5424 if singular is None: 5425 singular = 'katello_erratum' 5426 writer.write_start(singular) 5427 href = obj.href 5428 if href is not None: 5429 writer.write_attribute('href', href) 5430 if obj.id is not None: 5431 writer.write_attribute('id', obj.id) 5432 if obj.comment is not None: 5433 Writer.write_string(writer, 'comment', obj.comment) 5434 if obj.description is not None: 5435 Writer.write_string(writer, 'description', obj.description) 5436 if obj.issued is not None: 5437 Writer.write_date(writer, 'issued', obj.issued) 5438 if obj.name is not None: 5439 Writer.write_string(writer, 'name', obj.name) 5440 if obj.packages is not None: 5441 PackageWriter.write_many(obj.packages, writer, 'package', 'packages') 5442 if obj.severity is not None: 5443 Writer.write_string(writer, 'severity', obj.severity) 5444 if obj.solution is not None: 5445 Writer.write_string(writer, 'solution', obj.solution) 5446 if obj.summary is not None: 5447 Writer.write_string(writer, 'summary', obj.summary) 5448 if obj.title is not None: 5449 Writer.write_string(writer, 'title', obj.title) 5450 if obj.type is not None: 5451 Writer.write_string(writer, 'type', obj.type) 5452 if obj.host is not None: 5453 HostWriter.write_one(obj.host, writer, 'host') 5454 if obj.vm is not None: 5455 VmWriter.write_one(obj.vm, writer, 'vm') 5456 writer.write_end() 5457 5458 @staticmethod 5459 def write_many(objs, writer, singular=None, plural=None): 5460 if singular is None: 5461 singular = 'katello_erratum' 5462 if plural is None: 5463 plural = 'katello_errata' 5464 writer.write_start(plural) 5465 if isinstance(objs, List): 5466 href = objs.href 5467 if href is not None: 5468 writer.write_attribute('href', href) 5469 for obj in objs: 5470 KatelloErratumWriter.write_one(obj, writer, singular) 5471 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5422 @staticmethod 5423 def write_one(obj, writer, singular=None): 5424 if singular is None: 5425 singular = 'katello_erratum' 5426 writer.write_start(singular) 5427 href = obj.href 5428 if href is not None: 5429 writer.write_attribute('href', href) 5430 if obj.id is not None: 5431 writer.write_attribute('id', obj.id) 5432 if obj.comment is not None: 5433 Writer.write_string(writer, 'comment', obj.comment) 5434 if obj.description is not None: 5435 Writer.write_string(writer, 'description', obj.description) 5436 if obj.issued is not None: 5437 Writer.write_date(writer, 'issued', obj.issued) 5438 if obj.name is not None: 5439 Writer.write_string(writer, 'name', obj.name) 5440 if obj.packages is not None: 5441 PackageWriter.write_many(obj.packages, writer, 'package', 'packages') 5442 if obj.severity is not None: 5443 Writer.write_string(writer, 'severity', obj.severity) 5444 if obj.solution is not None: 5445 Writer.write_string(writer, 'solution', obj.solution) 5446 if obj.summary is not None: 5447 Writer.write_string(writer, 'summary', obj.summary) 5448 if obj.title is not None: 5449 Writer.write_string(writer, 'title', obj.title) 5450 if obj.type is not None: 5451 Writer.write_string(writer, 'type', obj.type) 5452 if obj.host is not None: 5453 HostWriter.write_one(obj.host, writer, 'host') 5454 if obj.vm is not None: 5455 VmWriter.write_one(obj.vm, writer, 'vm') 5456 writer.write_end()
5458 @staticmethod 5459 def write_many(objs, writer, singular=None, plural=None): 5460 if singular is None: 5461 singular = 'katello_erratum' 5462 if plural is None: 5463 plural = 'katello_errata' 5464 writer.write_start(plural) 5465 if isinstance(objs, List): 5466 href = objs.href 5467 if href is not None: 5468 writer.write_attribute('href', href) 5469 for obj in objs: 5470 KatelloErratumWriter.write_one(obj, writer, singular) 5471 writer.write_end()
5474class KernelWriter(Writer): 5475 5476 def __init__(self): 5477 super(KernelWriter, self).__init__() 5478 5479 @staticmethod 5480 def write_one(obj, writer, singular=None): 5481 if singular is None: 5482 singular = 'kernel' 5483 writer.write_start(singular) 5484 href = obj.href 5485 if href is not None: 5486 writer.write_attribute('href', href) 5487 if obj.version is not None: 5488 VersionWriter.write_one(obj.version, writer, 'version') 5489 writer.write_end() 5490 5491 @staticmethod 5492 def write_many(objs, writer, singular=None, plural=None): 5493 if singular is None: 5494 singular = 'kernel' 5495 if plural is None: 5496 plural = 'kernels' 5497 writer.write_start(plural) 5498 if isinstance(objs, List): 5499 href = objs.href 5500 if href is not None: 5501 writer.write_attribute('href', href) 5502 for obj in objs: 5503 KernelWriter.write_one(obj, writer, singular) 5504 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5479 @staticmethod 5480 def write_one(obj, writer, singular=None): 5481 if singular is None: 5482 singular = 'kernel' 5483 writer.write_start(singular) 5484 href = obj.href 5485 if href is not None: 5486 writer.write_attribute('href', href) 5487 if obj.version is not None: 5488 VersionWriter.write_one(obj.version, writer, 'version') 5489 writer.write_end()
5491 @staticmethod 5492 def write_many(objs, writer, singular=None, plural=None): 5493 if singular is None: 5494 singular = 'kernel' 5495 if plural is None: 5496 plural = 'kernels' 5497 writer.write_start(plural) 5498 if isinstance(objs, List): 5499 href = objs.href 5500 if href is not None: 5501 writer.write_attribute('href', href) 5502 for obj in objs: 5503 KernelWriter.write_one(obj, writer, singular) 5504 writer.write_end()
5507class KsmWriter(Writer): 5508 5509 def __init__(self): 5510 super(KsmWriter, self).__init__() 5511 5512 @staticmethod 5513 def write_one(obj, writer, singular=None): 5514 if singular is None: 5515 singular = 'ksm' 5516 writer.write_start(singular) 5517 href = obj.href 5518 if href is not None: 5519 writer.write_attribute('href', href) 5520 if obj.enabled is not None: 5521 Writer.write_boolean(writer, 'enabled', obj.enabled) 5522 if obj.merge_across_nodes is not None: 5523 Writer.write_boolean(writer, 'merge_across_nodes', obj.merge_across_nodes) 5524 writer.write_end() 5525 5526 @staticmethod 5527 def write_many(objs, writer, singular=None, plural=None): 5528 if singular is None: 5529 singular = 'ksm' 5530 if plural is None: 5531 plural = 'ksms' 5532 writer.write_start(plural) 5533 if isinstance(objs, List): 5534 href = objs.href 5535 if href is not None: 5536 writer.write_attribute('href', href) 5537 for obj in objs: 5538 KsmWriter.write_one(obj, writer, singular) 5539 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5512 @staticmethod 5513 def write_one(obj, writer, singular=None): 5514 if singular is None: 5515 singular = 'ksm' 5516 writer.write_start(singular) 5517 href = obj.href 5518 if href is not None: 5519 writer.write_attribute('href', href) 5520 if obj.enabled is not None: 5521 Writer.write_boolean(writer, 'enabled', obj.enabled) 5522 if obj.merge_across_nodes is not None: 5523 Writer.write_boolean(writer, 'merge_across_nodes', obj.merge_across_nodes) 5524 writer.write_end()
5526 @staticmethod 5527 def write_many(objs, writer, singular=None, plural=None): 5528 if singular is None: 5529 singular = 'ksm' 5530 if plural is None: 5531 plural = 'ksms' 5532 writer.write_start(plural) 5533 if isinstance(objs, List): 5534 href = objs.href 5535 if href is not None: 5536 writer.write_attribute('href', href) 5537 for obj in objs: 5538 KsmWriter.write_one(obj, writer, singular) 5539 writer.write_end()
5542class LinkLayerDiscoveryProtocolElementWriter(Writer): 5543 5544 def __init__(self): 5545 super(LinkLayerDiscoveryProtocolElementWriter, self).__init__() 5546 5547 @staticmethod 5548 def write_one(obj, writer, singular=None): 5549 if singular is None: 5550 singular = 'link_layer_discovery_protocol_element' 5551 writer.write_start(singular) 5552 href = obj.href 5553 if href is not None: 5554 writer.write_attribute('href', href) 5555 if obj.id is not None: 5556 writer.write_attribute('id', obj.id) 5557 if obj.comment is not None: 5558 Writer.write_string(writer, 'comment', obj.comment) 5559 if obj.description is not None: 5560 Writer.write_string(writer, 'description', obj.description) 5561 if obj.name is not None: 5562 Writer.write_string(writer, 'name', obj.name) 5563 if obj.oui is not None: 5564 Writer.write_integer(writer, 'oui', obj.oui) 5565 if obj.properties is not None: 5566 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 5567 if obj.subtype is not None: 5568 Writer.write_integer(writer, 'subtype', obj.subtype) 5569 if obj.type is not None: 5570 Writer.write_integer(writer, 'type', obj.type) 5571 writer.write_end() 5572 5573 @staticmethod 5574 def write_many(objs, writer, singular=None, plural=None): 5575 if singular is None: 5576 singular = 'link_layer_discovery_protocol_element' 5577 if plural is None: 5578 plural = 'link_layer_discovery_protocol_elements' 5579 writer.write_start(plural) 5580 if isinstance(objs, List): 5581 href = objs.href 5582 if href is not None: 5583 writer.write_attribute('href', href) 5584 for obj in objs: 5585 LinkLayerDiscoveryProtocolElementWriter.write_one(obj, writer, singular) 5586 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5547 @staticmethod 5548 def write_one(obj, writer, singular=None): 5549 if singular is None: 5550 singular = 'link_layer_discovery_protocol_element' 5551 writer.write_start(singular) 5552 href = obj.href 5553 if href is not None: 5554 writer.write_attribute('href', href) 5555 if obj.id is not None: 5556 writer.write_attribute('id', obj.id) 5557 if obj.comment is not None: 5558 Writer.write_string(writer, 'comment', obj.comment) 5559 if obj.description is not None: 5560 Writer.write_string(writer, 'description', obj.description) 5561 if obj.name is not None: 5562 Writer.write_string(writer, 'name', obj.name) 5563 if obj.oui is not None: 5564 Writer.write_integer(writer, 'oui', obj.oui) 5565 if obj.properties is not None: 5566 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 5567 if obj.subtype is not None: 5568 Writer.write_integer(writer, 'subtype', obj.subtype) 5569 if obj.type is not None: 5570 Writer.write_integer(writer, 'type', obj.type) 5571 writer.write_end()
5573 @staticmethod 5574 def write_many(objs, writer, singular=None, plural=None): 5575 if singular is None: 5576 singular = 'link_layer_discovery_protocol_element' 5577 if plural is None: 5578 plural = 'link_layer_discovery_protocol_elements' 5579 writer.write_start(plural) 5580 if isinstance(objs, List): 5581 href = objs.href 5582 if href is not None: 5583 writer.write_attribute('href', href) 5584 for obj in objs: 5585 LinkLayerDiscoveryProtocolElementWriter.write_one(obj, writer, singular) 5586 writer.write_end()
5589class LogicalUnitWriter(Writer): 5590 5591 def __init__(self): 5592 super(LogicalUnitWriter, self).__init__() 5593 5594 @staticmethod 5595 def write_one(obj, writer, singular=None): 5596 if singular is None: 5597 singular = 'logical_unit' 5598 writer.write_start(singular) 5599 href = obj.href 5600 if href is not None: 5601 writer.write_attribute('href', href) 5602 if obj.id is not None: 5603 writer.write_attribute('id', obj.id) 5604 if obj.active_paths is not None: 5605 Writer.write_integer(writer, 'active_paths', obj.active_paths) 5606 if obj.address is not None: 5607 Writer.write_string(writer, 'address', obj.address) 5608 if obj.discard_max_size is not None: 5609 Writer.write_integer(writer, 'discard_max_size', obj.discard_max_size) 5610 if obj.discard_zeroes_data is not None: 5611 Writer.write_boolean(writer, 'discard_zeroes_data', obj.discard_zeroes_data) 5612 if obj.disk_id is not None: 5613 Writer.write_string(writer, 'disk_id', obj.disk_id) 5614 if obj.lun_mapping is not None: 5615 Writer.write_integer(writer, 'lun_mapping', obj.lun_mapping) 5616 if obj.password is not None: 5617 Writer.write_string(writer, 'password', obj.password) 5618 if obj.paths is not None: 5619 Writer.write_integer(writer, 'paths', obj.paths) 5620 if obj.port is not None: 5621 Writer.write_integer(writer, 'port', obj.port) 5622 if obj.portal is not None: 5623 Writer.write_string(writer, 'portal', obj.portal) 5624 if obj.product_id is not None: 5625 Writer.write_string(writer, 'product_id', obj.product_id) 5626 if obj.serial is not None: 5627 Writer.write_string(writer, 'serial', obj.serial) 5628 if obj.size is not None: 5629 Writer.write_integer(writer, 'size', obj.size) 5630 if obj.status is not None: 5631 Writer.write_string(writer, 'status', obj.status.value) 5632 if obj.storage_domain_id is not None: 5633 Writer.write_string(writer, 'storage_domain_id', obj.storage_domain_id) 5634 if obj.target is not None: 5635 Writer.write_string(writer, 'target', obj.target) 5636 if obj.username is not None: 5637 Writer.write_string(writer, 'username', obj.username) 5638 if obj.vendor_id is not None: 5639 Writer.write_string(writer, 'vendor_id', obj.vendor_id) 5640 if obj.volume_group_id is not None: 5641 Writer.write_string(writer, 'volume_group_id', obj.volume_group_id) 5642 writer.write_end() 5643 5644 @staticmethod 5645 def write_many(objs, writer, singular=None, plural=None): 5646 if singular is None: 5647 singular = 'logical_unit' 5648 if plural is None: 5649 plural = 'logical_units' 5650 writer.write_start(plural) 5651 if isinstance(objs, List): 5652 href = objs.href 5653 if href is not None: 5654 writer.write_attribute('href', href) 5655 for obj in objs: 5656 LogicalUnitWriter.write_one(obj, writer, singular) 5657 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5594 @staticmethod 5595 def write_one(obj, writer, singular=None): 5596 if singular is None: 5597 singular = 'logical_unit' 5598 writer.write_start(singular) 5599 href = obj.href 5600 if href is not None: 5601 writer.write_attribute('href', href) 5602 if obj.id is not None: 5603 writer.write_attribute('id', obj.id) 5604 if obj.active_paths is not None: 5605 Writer.write_integer(writer, 'active_paths', obj.active_paths) 5606 if obj.address is not None: 5607 Writer.write_string(writer, 'address', obj.address) 5608 if obj.discard_max_size is not None: 5609 Writer.write_integer(writer, 'discard_max_size', obj.discard_max_size) 5610 if obj.discard_zeroes_data is not None: 5611 Writer.write_boolean(writer, 'discard_zeroes_data', obj.discard_zeroes_data) 5612 if obj.disk_id is not None: 5613 Writer.write_string(writer, 'disk_id', obj.disk_id) 5614 if obj.lun_mapping is not None: 5615 Writer.write_integer(writer, 'lun_mapping', obj.lun_mapping) 5616 if obj.password is not None: 5617 Writer.write_string(writer, 'password', obj.password) 5618 if obj.paths is not None: 5619 Writer.write_integer(writer, 'paths', obj.paths) 5620 if obj.port is not None: 5621 Writer.write_integer(writer, 'port', obj.port) 5622 if obj.portal is not None: 5623 Writer.write_string(writer, 'portal', obj.portal) 5624 if obj.product_id is not None: 5625 Writer.write_string(writer, 'product_id', obj.product_id) 5626 if obj.serial is not None: 5627 Writer.write_string(writer, 'serial', obj.serial) 5628 if obj.size is not None: 5629 Writer.write_integer(writer, 'size', obj.size) 5630 if obj.status is not None: 5631 Writer.write_string(writer, 'status', obj.status.value) 5632 if obj.storage_domain_id is not None: 5633 Writer.write_string(writer, 'storage_domain_id', obj.storage_domain_id) 5634 if obj.target is not None: 5635 Writer.write_string(writer, 'target', obj.target) 5636 if obj.username is not None: 5637 Writer.write_string(writer, 'username', obj.username) 5638 if obj.vendor_id is not None: 5639 Writer.write_string(writer, 'vendor_id', obj.vendor_id) 5640 if obj.volume_group_id is not None: 5641 Writer.write_string(writer, 'volume_group_id', obj.volume_group_id) 5642 writer.write_end()
5644 @staticmethod 5645 def write_many(objs, writer, singular=None, plural=None): 5646 if singular is None: 5647 singular = 'logical_unit' 5648 if plural is None: 5649 plural = 'logical_units' 5650 writer.write_start(plural) 5651 if isinstance(objs, List): 5652 href = objs.href 5653 if href is not None: 5654 writer.write_attribute('href', href) 5655 for obj in objs: 5656 LogicalUnitWriter.write_one(obj, writer, singular) 5657 writer.write_end()
5660class MDevTypeWriter(Writer): 5661 5662 def __init__(self): 5663 super(MDevTypeWriter, self).__init__() 5664 5665 @staticmethod 5666 def write_one(obj, writer, singular=None): 5667 if singular is None: 5668 singular = 'm_dev_type' 5669 writer.write_start(singular) 5670 href = obj.href 5671 if href is not None: 5672 writer.write_attribute('href', href) 5673 if obj.available_instances is not None: 5674 Writer.write_integer(writer, 'available_instances', obj.available_instances) 5675 if obj.description is not None: 5676 Writer.write_string(writer, 'description', obj.description) 5677 if obj.human_readable_name is not None: 5678 Writer.write_string(writer, 'human_readable_name', obj.human_readable_name) 5679 if obj.name is not None: 5680 Writer.write_string(writer, 'name', obj.name) 5681 writer.write_end() 5682 5683 @staticmethod 5684 def write_many(objs, writer, singular=None, plural=None): 5685 if singular is None: 5686 singular = 'm_dev_type' 5687 if plural is None: 5688 plural = 'm_dev_types' 5689 writer.write_start(plural) 5690 if isinstance(objs, List): 5691 href = objs.href 5692 if href is not None: 5693 writer.write_attribute('href', href) 5694 for obj in objs: 5695 MDevTypeWriter.write_one(obj, writer, singular) 5696 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5665 @staticmethod 5666 def write_one(obj, writer, singular=None): 5667 if singular is None: 5668 singular = 'm_dev_type' 5669 writer.write_start(singular) 5670 href = obj.href 5671 if href is not None: 5672 writer.write_attribute('href', href) 5673 if obj.available_instances is not None: 5674 Writer.write_integer(writer, 'available_instances', obj.available_instances) 5675 if obj.description is not None: 5676 Writer.write_string(writer, 'description', obj.description) 5677 if obj.human_readable_name is not None: 5678 Writer.write_string(writer, 'human_readable_name', obj.human_readable_name) 5679 if obj.name is not None: 5680 Writer.write_string(writer, 'name', obj.name) 5681 writer.write_end()
5683 @staticmethod 5684 def write_many(objs, writer, singular=None, plural=None): 5685 if singular is None: 5686 singular = 'm_dev_type' 5687 if plural is None: 5688 plural = 'm_dev_types' 5689 writer.write_start(plural) 5690 if isinstance(objs, List): 5691 href = objs.href 5692 if href is not None: 5693 writer.write_attribute('href', href) 5694 for obj in objs: 5695 MDevTypeWriter.write_one(obj, writer, singular) 5696 writer.write_end()
5699class MacWriter(Writer): 5700 5701 def __init__(self): 5702 super(MacWriter, self).__init__() 5703 5704 @staticmethod 5705 def write_one(obj, writer, singular=None): 5706 if singular is None: 5707 singular = 'mac' 5708 writer.write_start(singular) 5709 href = obj.href 5710 if href is not None: 5711 writer.write_attribute('href', href) 5712 if obj.address is not None: 5713 Writer.write_string(writer, 'address', obj.address) 5714 writer.write_end() 5715 5716 @staticmethod 5717 def write_many(objs, writer, singular=None, plural=None): 5718 if singular is None: 5719 singular = 'mac' 5720 if plural is None: 5721 plural = 'macs' 5722 writer.write_start(plural) 5723 if isinstance(objs, List): 5724 href = objs.href 5725 if href is not None: 5726 writer.write_attribute('href', href) 5727 for obj in objs: 5728 MacWriter.write_one(obj, writer, singular) 5729 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5704 @staticmethod 5705 def write_one(obj, writer, singular=None): 5706 if singular is None: 5707 singular = 'mac' 5708 writer.write_start(singular) 5709 href = obj.href 5710 if href is not None: 5711 writer.write_attribute('href', href) 5712 if obj.address is not None: 5713 Writer.write_string(writer, 'address', obj.address) 5714 writer.write_end()
5716 @staticmethod 5717 def write_many(objs, writer, singular=None, plural=None): 5718 if singular is None: 5719 singular = 'mac' 5720 if plural is None: 5721 plural = 'macs' 5722 writer.write_start(plural) 5723 if isinstance(objs, List): 5724 href = objs.href 5725 if href is not None: 5726 writer.write_attribute('href', href) 5727 for obj in objs: 5728 MacWriter.write_one(obj, writer, singular) 5729 writer.write_end()
5732class MacPoolWriter(Writer): 5733 5734 def __init__(self): 5735 super(MacPoolWriter, self).__init__() 5736 5737 @staticmethod 5738 def write_one(obj, writer, singular=None): 5739 if singular is None: 5740 singular = 'mac_pool' 5741 writer.write_start(singular) 5742 href = obj.href 5743 if href is not None: 5744 writer.write_attribute('href', href) 5745 if obj.id is not None: 5746 writer.write_attribute('id', obj.id) 5747 if obj.allow_duplicates is not None: 5748 Writer.write_boolean(writer, 'allow_duplicates', obj.allow_duplicates) 5749 if obj.comment is not None: 5750 Writer.write_string(writer, 'comment', obj.comment) 5751 if obj.default_pool is not None: 5752 Writer.write_boolean(writer, 'default_pool', obj.default_pool) 5753 if obj.description is not None: 5754 Writer.write_string(writer, 'description', obj.description) 5755 if obj.name is not None: 5756 Writer.write_string(writer, 'name', obj.name) 5757 if obj.ranges is not None: 5758 RangeWriter.write_many(obj.ranges, writer, 'range', 'ranges') 5759 if obj.permissions is not None: 5760 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 5761 writer.write_end() 5762 5763 @staticmethod 5764 def write_many(objs, writer, singular=None, plural=None): 5765 if singular is None: 5766 singular = 'mac_pool' 5767 if plural is None: 5768 plural = 'mac_pools' 5769 writer.write_start(plural) 5770 if isinstance(objs, List): 5771 href = objs.href 5772 if href is not None: 5773 writer.write_attribute('href', href) 5774 for obj in objs: 5775 MacPoolWriter.write_one(obj, writer, singular) 5776 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5737 @staticmethod 5738 def write_one(obj, writer, singular=None): 5739 if singular is None: 5740 singular = 'mac_pool' 5741 writer.write_start(singular) 5742 href = obj.href 5743 if href is not None: 5744 writer.write_attribute('href', href) 5745 if obj.id is not None: 5746 writer.write_attribute('id', obj.id) 5747 if obj.allow_duplicates is not None: 5748 Writer.write_boolean(writer, 'allow_duplicates', obj.allow_duplicates) 5749 if obj.comment is not None: 5750 Writer.write_string(writer, 'comment', obj.comment) 5751 if obj.default_pool is not None: 5752 Writer.write_boolean(writer, 'default_pool', obj.default_pool) 5753 if obj.description is not None: 5754 Writer.write_string(writer, 'description', obj.description) 5755 if obj.name is not None: 5756 Writer.write_string(writer, 'name', obj.name) 5757 if obj.ranges is not None: 5758 RangeWriter.write_many(obj.ranges, writer, 'range', 'ranges') 5759 if obj.permissions is not None: 5760 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 5761 writer.write_end()
5763 @staticmethod 5764 def write_many(objs, writer, singular=None, plural=None): 5765 if singular is None: 5766 singular = 'mac_pool' 5767 if plural is None: 5768 plural = 'mac_pools' 5769 writer.write_start(plural) 5770 if isinstance(objs, List): 5771 href = objs.href 5772 if href is not None: 5773 writer.write_attribute('href', href) 5774 for obj in objs: 5775 MacPoolWriter.write_one(obj, writer, singular) 5776 writer.write_end()
5779class MemoryOverCommitWriter(Writer): 5780 5781 def __init__(self): 5782 super(MemoryOverCommitWriter, self).__init__() 5783 5784 @staticmethod 5785 def write_one(obj, writer, singular=None): 5786 if singular is None: 5787 singular = 'memory_over_commit' 5788 writer.write_start(singular) 5789 href = obj.href 5790 if href is not None: 5791 writer.write_attribute('href', href) 5792 if obj.percent is not None: 5793 Writer.write_integer(writer, 'percent', obj.percent) 5794 writer.write_end() 5795 5796 @staticmethod 5797 def write_many(objs, writer, singular=None, plural=None): 5798 if singular is None: 5799 singular = 'memory_over_commit' 5800 if plural is None: 5801 plural = 'memory_over_commits' 5802 writer.write_start(plural) 5803 if isinstance(objs, List): 5804 href = objs.href 5805 if href is not None: 5806 writer.write_attribute('href', href) 5807 for obj in objs: 5808 MemoryOverCommitWriter.write_one(obj, writer, singular) 5809 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5784 @staticmethod 5785 def write_one(obj, writer, singular=None): 5786 if singular is None: 5787 singular = 'memory_over_commit' 5788 writer.write_start(singular) 5789 href = obj.href 5790 if href is not None: 5791 writer.write_attribute('href', href) 5792 if obj.percent is not None: 5793 Writer.write_integer(writer, 'percent', obj.percent) 5794 writer.write_end()
5796 @staticmethod 5797 def write_many(objs, writer, singular=None, plural=None): 5798 if singular is None: 5799 singular = 'memory_over_commit' 5800 if plural is None: 5801 plural = 'memory_over_commits' 5802 writer.write_start(plural) 5803 if isinstance(objs, List): 5804 href = objs.href 5805 if href is not None: 5806 writer.write_attribute('href', href) 5807 for obj in objs: 5808 MemoryOverCommitWriter.write_one(obj, writer, singular) 5809 writer.write_end()
5812class MemoryPolicyWriter(Writer): 5813 5814 def __init__(self): 5815 super(MemoryPolicyWriter, self).__init__() 5816 5817 @staticmethod 5818 def write_one(obj, writer, singular=None): 5819 if singular is None: 5820 singular = 'memory_policy' 5821 writer.write_start(singular) 5822 href = obj.href 5823 if href is not None: 5824 writer.write_attribute('href', href) 5825 if obj.ballooning is not None: 5826 Writer.write_boolean(writer, 'ballooning', obj.ballooning) 5827 if obj.guaranteed is not None: 5828 Writer.write_integer(writer, 'guaranteed', obj.guaranteed) 5829 if obj.max is not None: 5830 Writer.write_integer(writer, 'max', obj.max) 5831 if obj.over_commit is not None: 5832 MemoryOverCommitWriter.write_one(obj.over_commit, writer, 'over_commit') 5833 if obj.transparent_huge_pages is not None: 5834 TransparentHugePagesWriter.write_one(obj.transparent_huge_pages, writer, 'transparent_hugepages') 5835 writer.write_end() 5836 5837 @staticmethod 5838 def write_many(objs, writer, singular=None, plural=None): 5839 if singular is None: 5840 singular = 'memory_policy' 5841 if plural is None: 5842 plural = 'memory_policies' 5843 writer.write_start(plural) 5844 if isinstance(objs, List): 5845 href = objs.href 5846 if href is not None: 5847 writer.write_attribute('href', href) 5848 for obj in objs: 5849 MemoryPolicyWriter.write_one(obj, writer, singular) 5850 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5817 @staticmethod 5818 def write_one(obj, writer, singular=None): 5819 if singular is None: 5820 singular = 'memory_policy' 5821 writer.write_start(singular) 5822 href = obj.href 5823 if href is not None: 5824 writer.write_attribute('href', href) 5825 if obj.ballooning is not None: 5826 Writer.write_boolean(writer, 'ballooning', obj.ballooning) 5827 if obj.guaranteed is not None: 5828 Writer.write_integer(writer, 'guaranteed', obj.guaranteed) 5829 if obj.max is not None: 5830 Writer.write_integer(writer, 'max', obj.max) 5831 if obj.over_commit is not None: 5832 MemoryOverCommitWriter.write_one(obj.over_commit, writer, 'over_commit') 5833 if obj.transparent_huge_pages is not None: 5834 TransparentHugePagesWriter.write_one(obj.transparent_huge_pages, writer, 'transparent_hugepages') 5835 writer.write_end()
5837 @staticmethod 5838 def write_many(objs, writer, singular=None, plural=None): 5839 if singular is None: 5840 singular = 'memory_policy' 5841 if plural is None: 5842 plural = 'memory_policies' 5843 writer.write_start(plural) 5844 if isinstance(objs, List): 5845 href = objs.href 5846 if href is not None: 5847 writer.write_attribute('href', href) 5848 for obj in objs: 5849 MemoryPolicyWriter.write_one(obj, writer, singular) 5850 writer.write_end()
5853class MethodWriter(Writer): 5854 5855 def __init__(self): 5856 super(MethodWriter, self).__init__() 5857 5858 @staticmethod 5859 def write_one(obj, writer, singular=None): 5860 if singular is None: 5861 singular = 'method' 5862 writer.write_start(singular) 5863 href = obj.href 5864 if href is not None: 5865 writer.write_attribute('href', href) 5866 if obj.id is not None: 5867 writer.write_attribute('id', obj.id.value) 5868 writer.write_end() 5869 5870 @staticmethod 5871 def write_many(objs, writer, singular=None, plural=None): 5872 if singular is None: 5873 singular = 'method' 5874 if plural is None: 5875 plural = 'methods' 5876 writer.write_start(plural) 5877 if isinstance(objs, List): 5878 href = objs.href 5879 if href is not None: 5880 writer.write_attribute('href', href) 5881 for obj in objs: 5882 MethodWriter.write_one(obj, writer, singular) 5883 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5858 @staticmethod 5859 def write_one(obj, writer, singular=None): 5860 if singular is None: 5861 singular = 'method' 5862 writer.write_start(singular) 5863 href = obj.href 5864 if href is not None: 5865 writer.write_attribute('href', href) 5866 if obj.id is not None: 5867 writer.write_attribute('id', obj.id.value) 5868 writer.write_end()
5870 @staticmethod 5871 def write_many(objs, writer, singular=None, plural=None): 5872 if singular is None: 5873 singular = 'method' 5874 if plural is None: 5875 plural = 'methods' 5876 writer.write_start(plural) 5877 if isinstance(objs, List): 5878 href = objs.href 5879 if href is not None: 5880 writer.write_attribute('href', href) 5881 for obj in objs: 5882 MethodWriter.write_one(obj, writer, singular) 5883 writer.write_end()
5886class MigrationBandwidthWriter(Writer): 5887 5888 def __init__(self): 5889 super(MigrationBandwidthWriter, self).__init__() 5890 5891 @staticmethod 5892 def write_one(obj, writer, singular=None): 5893 if singular is None: 5894 singular = 'migration_bandwidth' 5895 writer.write_start(singular) 5896 href = obj.href 5897 if href is not None: 5898 writer.write_attribute('href', href) 5899 if obj.assignment_method is not None: 5900 Writer.write_string(writer, 'assignment_method', obj.assignment_method.value) 5901 if obj.custom_value is not None: 5902 Writer.write_integer(writer, 'custom_value', obj.custom_value) 5903 writer.write_end() 5904 5905 @staticmethod 5906 def write_many(objs, writer, singular=None, plural=None): 5907 if singular is None: 5908 singular = 'migration_bandwidth' 5909 if plural is None: 5910 plural = 'migration_bandwidths' 5911 writer.write_start(plural) 5912 if isinstance(objs, List): 5913 href = objs.href 5914 if href is not None: 5915 writer.write_attribute('href', href) 5916 for obj in objs: 5917 MigrationBandwidthWriter.write_one(obj, writer, singular) 5918 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5891 @staticmethod 5892 def write_one(obj, writer, singular=None): 5893 if singular is None: 5894 singular = 'migration_bandwidth' 5895 writer.write_start(singular) 5896 href = obj.href 5897 if href is not None: 5898 writer.write_attribute('href', href) 5899 if obj.assignment_method is not None: 5900 Writer.write_string(writer, 'assignment_method', obj.assignment_method.value) 5901 if obj.custom_value is not None: 5902 Writer.write_integer(writer, 'custom_value', obj.custom_value) 5903 writer.write_end()
5905 @staticmethod 5906 def write_many(objs, writer, singular=None, plural=None): 5907 if singular is None: 5908 singular = 'migration_bandwidth' 5909 if plural is None: 5910 plural = 'migration_bandwidths' 5911 writer.write_start(plural) 5912 if isinstance(objs, List): 5913 href = objs.href 5914 if href is not None: 5915 writer.write_attribute('href', href) 5916 for obj in objs: 5917 MigrationBandwidthWriter.write_one(obj, writer, singular) 5918 writer.write_end()
5921class MigrationOptionsWriter(Writer): 5922 5923 def __init__(self): 5924 super(MigrationOptionsWriter, self).__init__() 5925 5926 @staticmethod 5927 def write_one(obj, writer, singular=None): 5928 if singular is None: 5929 singular = 'migration' 5930 writer.write_start(singular) 5931 href = obj.href 5932 if href is not None: 5933 writer.write_attribute('href', href) 5934 if obj.auto_converge is not None: 5935 Writer.write_string(writer, 'auto_converge', obj.auto_converge.value) 5936 if obj.bandwidth is not None: 5937 MigrationBandwidthWriter.write_one(obj.bandwidth, writer, 'bandwidth') 5938 if obj.compressed is not None: 5939 Writer.write_string(writer, 'compressed', obj.compressed.value) 5940 if obj.custom_parallel_migrations is not None: 5941 Writer.write_integer(writer, 'custom_parallel_migrations', obj.custom_parallel_migrations) 5942 if obj.encrypted is not None: 5943 Writer.write_string(writer, 'encrypted', obj.encrypted.value) 5944 if obj.parallel_migrations_policy is not None: 5945 Writer.write_string(writer, 'parallel_migrations_policy', obj.parallel_migrations_policy.value) 5946 if obj.policy is not None: 5947 MigrationPolicyWriter.write_one(obj.policy, writer, 'policy') 5948 writer.write_end() 5949 5950 @staticmethod 5951 def write_many(objs, writer, singular=None, plural=None): 5952 if singular is None: 5953 singular = 'migration' 5954 if plural is None: 5955 plural = 'migration_optionss' 5956 writer.write_start(plural) 5957 if isinstance(objs, List): 5958 href = objs.href 5959 if href is not None: 5960 writer.write_attribute('href', href) 5961 for obj in objs: 5962 MigrationOptionsWriter.write_one(obj, writer, singular) 5963 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5926 @staticmethod 5927 def write_one(obj, writer, singular=None): 5928 if singular is None: 5929 singular = 'migration' 5930 writer.write_start(singular) 5931 href = obj.href 5932 if href is not None: 5933 writer.write_attribute('href', href) 5934 if obj.auto_converge is not None: 5935 Writer.write_string(writer, 'auto_converge', obj.auto_converge.value) 5936 if obj.bandwidth is not None: 5937 MigrationBandwidthWriter.write_one(obj.bandwidth, writer, 'bandwidth') 5938 if obj.compressed is not None: 5939 Writer.write_string(writer, 'compressed', obj.compressed.value) 5940 if obj.custom_parallel_migrations is not None: 5941 Writer.write_integer(writer, 'custom_parallel_migrations', obj.custom_parallel_migrations) 5942 if obj.encrypted is not None: 5943 Writer.write_string(writer, 'encrypted', obj.encrypted.value) 5944 if obj.parallel_migrations_policy is not None: 5945 Writer.write_string(writer, 'parallel_migrations_policy', obj.parallel_migrations_policy.value) 5946 if obj.policy is not None: 5947 MigrationPolicyWriter.write_one(obj.policy, writer, 'policy') 5948 writer.write_end()
5950 @staticmethod 5951 def write_many(objs, writer, singular=None, plural=None): 5952 if singular is None: 5953 singular = 'migration' 5954 if plural is None: 5955 plural = 'migration_optionss' 5956 writer.write_start(plural) 5957 if isinstance(objs, List): 5958 href = objs.href 5959 if href is not None: 5960 writer.write_attribute('href', href) 5961 for obj in objs: 5962 MigrationOptionsWriter.write_one(obj, writer, singular) 5963 writer.write_end()
5966class MigrationPolicyWriter(Writer): 5967 5968 def __init__(self): 5969 super(MigrationPolicyWriter, self).__init__() 5970 5971 @staticmethod 5972 def write_one(obj, writer, singular=None): 5973 if singular is None: 5974 singular = 'migration_policy' 5975 writer.write_start(singular) 5976 href = obj.href 5977 if href is not None: 5978 writer.write_attribute('href', href) 5979 if obj.id is not None: 5980 writer.write_attribute('id', obj.id) 5981 if obj.comment is not None: 5982 Writer.write_string(writer, 'comment', obj.comment) 5983 if obj.description is not None: 5984 Writer.write_string(writer, 'description', obj.description) 5985 if obj.name is not None: 5986 Writer.write_string(writer, 'name', obj.name) 5987 writer.write_end() 5988 5989 @staticmethod 5990 def write_many(objs, writer, singular=None, plural=None): 5991 if singular is None: 5992 singular = 'migration_policy' 5993 if plural is None: 5994 plural = 'migration_policies' 5995 writer.write_start(plural) 5996 if isinstance(objs, List): 5997 href = objs.href 5998 if href is not None: 5999 writer.write_attribute('href', href) 6000 for obj in objs: 6001 MigrationPolicyWriter.write_one(obj, writer, singular) 6002 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
5971 @staticmethod 5972 def write_one(obj, writer, singular=None): 5973 if singular is None: 5974 singular = 'migration_policy' 5975 writer.write_start(singular) 5976 href = obj.href 5977 if href is not None: 5978 writer.write_attribute('href', href) 5979 if obj.id is not None: 5980 writer.write_attribute('id', obj.id) 5981 if obj.comment is not None: 5982 Writer.write_string(writer, 'comment', obj.comment) 5983 if obj.description is not None: 5984 Writer.write_string(writer, 'description', obj.description) 5985 if obj.name is not None: 5986 Writer.write_string(writer, 'name', obj.name) 5987 writer.write_end()
5989 @staticmethod 5990 def write_many(objs, writer, singular=None, plural=None): 5991 if singular is None: 5992 singular = 'migration_policy' 5993 if plural is None: 5994 plural = 'migration_policies' 5995 writer.write_start(plural) 5996 if isinstance(objs, List): 5997 href = objs.href 5998 if href is not None: 5999 writer.write_attribute('href', href) 6000 for obj in objs: 6001 MigrationPolicyWriter.write_one(obj, writer, singular) 6002 writer.write_end()
6005class NetworkWriter(Writer): 6006 6007 def __init__(self): 6008 super(NetworkWriter, self).__init__() 6009 6010 @staticmethod 6011 def write_one(obj, writer, singular=None): 6012 if singular is None: 6013 singular = 'network' 6014 writer.write_start(singular) 6015 href = obj.href 6016 if href is not None: 6017 writer.write_attribute('href', href) 6018 if obj.id is not None: 6019 writer.write_attribute('id', obj.id) 6020 if obj.comment is not None: 6021 Writer.write_string(writer, 'comment', obj.comment) 6022 if obj.description is not None: 6023 Writer.write_string(writer, 'description', obj.description) 6024 if obj.display is not None: 6025 Writer.write_boolean(writer, 'display', obj.display) 6026 if obj.dns_resolver_configuration is not None: 6027 DnsResolverConfigurationWriter.write_one(obj.dns_resolver_configuration, writer, 'dns_resolver_configuration') 6028 if obj.ip is not None: 6029 IpWriter.write_one(obj.ip, writer, 'ip') 6030 if obj.mtu is not None: 6031 Writer.write_integer(writer, 'mtu', obj.mtu) 6032 if obj.name is not None: 6033 Writer.write_string(writer, 'name', obj.name) 6034 if obj.port_isolation is not None: 6035 Writer.write_boolean(writer, 'port_isolation', obj.port_isolation) 6036 if obj.profile_required is not None: 6037 Writer.write_boolean(writer, 'profile_required', obj.profile_required) 6038 if obj.required is not None: 6039 Writer.write_boolean(writer, 'required', obj.required) 6040 if obj.status is not None: 6041 Writer.write_string(writer, 'status', obj.status.value) 6042 if obj.stp is not None: 6043 Writer.write_boolean(writer, 'stp', obj.stp) 6044 if obj.usages is not None: 6045 writer.write_start('usages') 6046 for item in obj.usages: 6047 if item is not None: 6048 Writer.write_string(writer, 'usage', item.value) 6049 writer.write_end() 6050 if obj.vdsm_name is not None: 6051 Writer.write_string(writer, 'vdsm_name', obj.vdsm_name) 6052 if obj.vlan is not None: 6053 VlanWriter.write_one(obj.vlan, writer, 'vlan') 6054 if obj.cluster is not None: 6055 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 6056 if obj.data_center is not None: 6057 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 6058 if obj.external_provider is not None: 6059 OpenStackNetworkProviderWriter.write_one(obj.external_provider, writer, 'external_provider') 6060 if obj.external_provider_physical_network is not None: 6061 NetworkWriter.write_one(obj.external_provider_physical_network, writer, 'external_provider_physical_network') 6062 if obj.network_labels is not None: 6063 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 6064 if obj.permissions is not None: 6065 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 6066 if obj.qos is not None: 6067 QosWriter.write_one(obj.qos, writer, 'qos') 6068 if obj.vnic_profiles is not None: 6069 VnicProfileWriter.write_many(obj.vnic_profiles, writer, 'vnic_profile', 'vnic_profiles') 6070 writer.write_end() 6071 6072 @staticmethod 6073 def write_many(objs, writer, singular=None, plural=None): 6074 if singular is None: 6075 singular = 'network' 6076 if plural is None: 6077 plural = 'networks' 6078 writer.write_start(plural) 6079 if isinstance(objs, List): 6080 href = objs.href 6081 if href is not None: 6082 writer.write_attribute('href', href) 6083 for obj in objs: 6084 NetworkWriter.write_one(obj, writer, singular) 6085 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6010 @staticmethod 6011 def write_one(obj, writer, singular=None): 6012 if singular is None: 6013 singular = 'network' 6014 writer.write_start(singular) 6015 href = obj.href 6016 if href is not None: 6017 writer.write_attribute('href', href) 6018 if obj.id is not None: 6019 writer.write_attribute('id', obj.id) 6020 if obj.comment is not None: 6021 Writer.write_string(writer, 'comment', obj.comment) 6022 if obj.description is not None: 6023 Writer.write_string(writer, 'description', obj.description) 6024 if obj.display is not None: 6025 Writer.write_boolean(writer, 'display', obj.display) 6026 if obj.dns_resolver_configuration is not None: 6027 DnsResolverConfigurationWriter.write_one(obj.dns_resolver_configuration, writer, 'dns_resolver_configuration') 6028 if obj.ip is not None: 6029 IpWriter.write_one(obj.ip, writer, 'ip') 6030 if obj.mtu is not None: 6031 Writer.write_integer(writer, 'mtu', obj.mtu) 6032 if obj.name is not None: 6033 Writer.write_string(writer, 'name', obj.name) 6034 if obj.port_isolation is not None: 6035 Writer.write_boolean(writer, 'port_isolation', obj.port_isolation) 6036 if obj.profile_required is not None: 6037 Writer.write_boolean(writer, 'profile_required', obj.profile_required) 6038 if obj.required is not None: 6039 Writer.write_boolean(writer, 'required', obj.required) 6040 if obj.status is not None: 6041 Writer.write_string(writer, 'status', obj.status.value) 6042 if obj.stp is not None: 6043 Writer.write_boolean(writer, 'stp', obj.stp) 6044 if obj.usages is not None: 6045 writer.write_start('usages') 6046 for item in obj.usages: 6047 if item is not None: 6048 Writer.write_string(writer, 'usage', item.value) 6049 writer.write_end() 6050 if obj.vdsm_name is not None: 6051 Writer.write_string(writer, 'vdsm_name', obj.vdsm_name) 6052 if obj.vlan is not None: 6053 VlanWriter.write_one(obj.vlan, writer, 'vlan') 6054 if obj.cluster is not None: 6055 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 6056 if obj.data_center is not None: 6057 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 6058 if obj.external_provider is not None: 6059 OpenStackNetworkProviderWriter.write_one(obj.external_provider, writer, 'external_provider') 6060 if obj.external_provider_physical_network is not None: 6061 NetworkWriter.write_one(obj.external_provider_physical_network, writer, 'external_provider_physical_network') 6062 if obj.network_labels is not None: 6063 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 6064 if obj.permissions is not None: 6065 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 6066 if obj.qos is not None: 6067 QosWriter.write_one(obj.qos, writer, 'qos') 6068 if obj.vnic_profiles is not None: 6069 VnicProfileWriter.write_many(obj.vnic_profiles, writer, 'vnic_profile', 'vnic_profiles') 6070 writer.write_end()
6072 @staticmethod 6073 def write_many(objs, writer, singular=None, plural=None): 6074 if singular is None: 6075 singular = 'network' 6076 if plural is None: 6077 plural = 'networks' 6078 writer.write_start(plural) 6079 if isinstance(objs, List): 6080 href = objs.href 6081 if href is not None: 6082 writer.write_attribute('href', href) 6083 for obj in objs: 6084 NetworkWriter.write_one(obj, writer, singular) 6085 writer.write_end()
6088class NetworkAttachmentWriter(Writer): 6089 6090 def __init__(self): 6091 super(NetworkAttachmentWriter, self).__init__() 6092 6093 @staticmethod 6094 def write_one(obj, writer, singular=None): 6095 if singular is None: 6096 singular = 'network_attachment' 6097 writer.write_start(singular) 6098 href = obj.href 6099 if href is not None: 6100 writer.write_attribute('href', href) 6101 if obj.id is not None: 6102 writer.write_attribute('id', obj.id) 6103 if obj.comment is not None: 6104 Writer.write_string(writer, 'comment', obj.comment) 6105 if obj.description is not None: 6106 Writer.write_string(writer, 'description', obj.description) 6107 if obj.dns_resolver_configuration is not None: 6108 DnsResolverConfigurationWriter.write_one(obj.dns_resolver_configuration, writer, 'dns_resolver_configuration') 6109 if obj.in_sync is not None: 6110 Writer.write_boolean(writer, 'in_sync', obj.in_sync) 6111 if obj.ip_address_assignments is not None: 6112 IpAddressAssignmentWriter.write_many(obj.ip_address_assignments, writer, 'ip_address_assignment', 'ip_address_assignments') 6113 if obj.name is not None: 6114 Writer.write_string(writer, 'name', obj.name) 6115 if obj.properties is not None: 6116 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6117 if obj.reported_configurations is not None: 6118 ReportedConfigurationWriter.write_many(obj.reported_configurations, writer, 'reported_configuration', 'reported_configurations') 6119 if obj.host is not None: 6120 HostWriter.write_one(obj.host, writer, 'host') 6121 if obj.host_nic is not None: 6122 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 6123 if obj.network is not None: 6124 NetworkWriter.write_one(obj.network, writer, 'network') 6125 if obj.qos is not None: 6126 QosWriter.write_one(obj.qos, writer, 'qos') 6127 writer.write_end() 6128 6129 @staticmethod 6130 def write_many(objs, writer, singular=None, plural=None): 6131 if singular is None: 6132 singular = 'network_attachment' 6133 if plural is None: 6134 plural = 'network_attachments' 6135 writer.write_start(plural) 6136 if isinstance(objs, List): 6137 href = objs.href 6138 if href is not None: 6139 writer.write_attribute('href', href) 6140 for obj in objs: 6141 NetworkAttachmentWriter.write_one(obj, writer, singular) 6142 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6093 @staticmethod 6094 def write_one(obj, writer, singular=None): 6095 if singular is None: 6096 singular = 'network_attachment' 6097 writer.write_start(singular) 6098 href = obj.href 6099 if href is not None: 6100 writer.write_attribute('href', href) 6101 if obj.id is not None: 6102 writer.write_attribute('id', obj.id) 6103 if obj.comment is not None: 6104 Writer.write_string(writer, 'comment', obj.comment) 6105 if obj.description is not None: 6106 Writer.write_string(writer, 'description', obj.description) 6107 if obj.dns_resolver_configuration is not None: 6108 DnsResolverConfigurationWriter.write_one(obj.dns_resolver_configuration, writer, 'dns_resolver_configuration') 6109 if obj.in_sync is not None: 6110 Writer.write_boolean(writer, 'in_sync', obj.in_sync) 6111 if obj.ip_address_assignments is not None: 6112 IpAddressAssignmentWriter.write_many(obj.ip_address_assignments, writer, 'ip_address_assignment', 'ip_address_assignments') 6113 if obj.name is not None: 6114 Writer.write_string(writer, 'name', obj.name) 6115 if obj.properties is not None: 6116 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6117 if obj.reported_configurations is not None: 6118 ReportedConfigurationWriter.write_many(obj.reported_configurations, writer, 'reported_configuration', 'reported_configurations') 6119 if obj.host is not None: 6120 HostWriter.write_one(obj.host, writer, 'host') 6121 if obj.host_nic is not None: 6122 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 6123 if obj.network is not None: 6124 NetworkWriter.write_one(obj.network, writer, 'network') 6125 if obj.qos is not None: 6126 QosWriter.write_one(obj.qos, writer, 'qos') 6127 writer.write_end()
6129 @staticmethod 6130 def write_many(objs, writer, singular=None, plural=None): 6131 if singular is None: 6132 singular = 'network_attachment' 6133 if plural is None: 6134 plural = 'network_attachments' 6135 writer.write_start(plural) 6136 if isinstance(objs, List): 6137 href = objs.href 6138 if href is not None: 6139 writer.write_attribute('href', href) 6140 for obj in objs: 6141 NetworkAttachmentWriter.write_one(obj, writer, singular) 6142 writer.write_end()
6145class NetworkConfigurationWriter(Writer): 6146 6147 def __init__(self): 6148 super(NetworkConfigurationWriter, self).__init__() 6149 6150 @staticmethod 6151 def write_one(obj, writer, singular=None): 6152 if singular is None: 6153 singular = 'network_configuration' 6154 writer.write_start(singular) 6155 href = obj.href 6156 if href is not None: 6157 writer.write_attribute('href', href) 6158 if obj.dns is not None: 6159 DnsWriter.write_one(obj.dns, writer, 'dns') 6160 if obj.nics is not None: 6161 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 6162 writer.write_end() 6163 6164 @staticmethod 6165 def write_many(objs, writer, singular=None, plural=None): 6166 if singular is None: 6167 singular = 'network_configuration' 6168 if plural is None: 6169 plural = 'network_configurations' 6170 writer.write_start(plural) 6171 if isinstance(objs, List): 6172 href = objs.href 6173 if href is not None: 6174 writer.write_attribute('href', href) 6175 for obj in objs: 6176 NetworkConfigurationWriter.write_one(obj, writer, singular) 6177 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6150 @staticmethod 6151 def write_one(obj, writer, singular=None): 6152 if singular is None: 6153 singular = 'network_configuration' 6154 writer.write_start(singular) 6155 href = obj.href 6156 if href is not None: 6157 writer.write_attribute('href', href) 6158 if obj.dns is not None: 6159 DnsWriter.write_one(obj.dns, writer, 'dns') 6160 if obj.nics is not None: 6161 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 6162 writer.write_end()
6164 @staticmethod 6165 def write_many(objs, writer, singular=None, plural=None): 6166 if singular is None: 6167 singular = 'network_configuration' 6168 if plural is None: 6169 plural = 'network_configurations' 6170 writer.write_start(plural) 6171 if isinstance(objs, List): 6172 href = objs.href 6173 if href is not None: 6174 writer.write_attribute('href', href) 6175 for obj in objs: 6176 NetworkConfigurationWriter.write_one(obj, writer, singular) 6177 writer.write_end()
6180class NetworkFilterWriter(Writer): 6181 6182 def __init__(self): 6183 super(NetworkFilterWriter, self).__init__() 6184 6185 @staticmethod 6186 def write_one(obj, writer, singular=None): 6187 if singular is None: 6188 singular = 'network_filter' 6189 writer.write_start(singular) 6190 href = obj.href 6191 if href is not None: 6192 writer.write_attribute('href', href) 6193 if obj.id is not None: 6194 writer.write_attribute('id', obj.id) 6195 if obj.comment is not None: 6196 Writer.write_string(writer, 'comment', obj.comment) 6197 if obj.description is not None: 6198 Writer.write_string(writer, 'description', obj.description) 6199 if obj.name is not None: 6200 Writer.write_string(writer, 'name', obj.name) 6201 if obj.version is not None: 6202 VersionWriter.write_one(obj.version, writer, 'version') 6203 writer.write_end() 6204 6205 @staticmethod 6206 def write_many(objs, writer, singular=None, plural=None): 6207 if singular is None: 6208 singular = 'network_filter' 6209 if plural is None: 6210 plural = 'network_filters' 6211 writer.write_start(plural) 6212 if isinstance(objs, List): 6213 href = objs.href 6214 if href is not None: 6215 writer.write_attribute('href', href) 6216 for obj in objs: 6217 NetworkFilterWriter.write_one(obj, writer, singular) 6218 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6185 @staticmethod 6186 def write_one(obj, writer, singular=None): 6187 if singular is None: 6188 singular = 'network_filter' 6189 writer.write_start(singular) 6190 href = obj.href 6191 if href is not None: 6192 writer.write_attribute('href', href) 6193 if obj.id is not None: 6194 writer.write_attribute('id', obj.id) 6195 if obj.comment is not None: 6196 Writer.write_string(writer, 'comment', obj.comment) 6197 if obj.description is not None: 6198 Writer.write_string(writer, 'description', obj.description) 6199 if obj.name is not None: 6200 Writer.write_string(writer, 'name', obj.name) 6201 if obj.version is not None: 6202 VersionWriter.write_one(obj.version, writer, 'version') 6203 writer.write_end()
6205 @staticmethod 6206 def write_many(objs, writer, singular=None, plural=None): 6207 if singular is None: 6208 singular = 'network_filter' 6209 if plural is None: 6210 plural = 'network_filters' 6211 writer.write_start(plural) 6212 if isinstance(objs, List): 6213 href = objs.href 6214 if href is not None: 6215 writer.write_attribute('href', href) 6216 for obj in objs: 6217 NetworkFilterWriter.write_one(obj, writer, singular) 6218 writer.write_end()
6221class NetworkFilterParameterWriter(Writer): 6222 6223 def __init__(self): 6224 super(NetworkFilterParameterWriter, self).__init__() 6225 6226 @staticmethod 6227 def write_one(obj, writer, singular=None): 6228 if singular is None: 6229 singular = 'network_filter_parameter' 6230 writer.write_start(singular) 6231 href = obj.href 6232 if href is not None: 6233 writer.write_attribute('href', href) 6234 if obj.id is not None: 6235 writer.write_attribute('id', obj.id) 6236 if obj.comment is not None: 6237 Writer.write_string(writer, 'comment', obj.comment) 6238 if obj.description is not None: 6239 Writer.write_string(writer, 'description', obj.description) 6240 if obj.name is not None: 6241 Writer.write_string(writer, 'name', obj.name) 6242 if obj.value is not None: 6243 Writer.write_string(writer, 'value', obj.value) 6244 if obj.nic is not None: 6245 NicWriter.write_one(obj.nic, writer, 'nic') 6246 writer.write_end() 6247 6248 @staticmethod 6249 def write_many(objs, writer, singular=None, plural=None): 6250 if singular is None: 6251 singular = 'network_filter_parameter' 6252 if plural is None: 6253 plural = 'network_filter_parameters' 6254 writer.write_start(plural) 6255 if isinstance(objs, List): 6256 href = objs.href 6257 if href is not None: 6258 writer.write_attribute('href', href) 6259 for obj in objs: 6260 NetworkFilterParameterWriter.write_one(obj, writer, singular) 6261 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6226 @staticmethod 6227 def write_one(obj, writer, singular=None): 6228 if singular is None: 6229 singular = 'network_filter_parameter' 6230 writer.write_start(singular) 6231 href = obj.href 6232 if href is not None: 6233 writer.write_attribute('href', href) 6234 if obj.id is not None: 6235 writer.write_attribute('id', obj.id) 6236 if obj.comment is not None: 6237 Writer.write_string(writer, 'comment', obj.comment) 6238 if obj.description is not None: 6239 Writer.write_string(writer, 'description', obj.description) 6240 if obj.name is not None: 6241 Writer.write_string(writer, 'name', obj.name) 6242 if obj.value is not None: 6243 Writer.write_string(writer, 'value', obj.value) 6244 if obj.nic is not None: 6245 NicWriter.write_one(obj.nic, writer, 'nic') 6246 writer.write_end()
6248 @staticmethod 6249 def write_many(objs, writer, singular=None, plural=None): 6250 if singular is None: 6251 singular = 'network_filter_parameter' 6252 if plural is None: 6253 plural = 'network_filter_parameters' 6254 writer.write_start(plural) 6255 if isinstance(objs, List): 6256 href = objs.href 6257 if href is not None: 6258 writer.write_attribute('href', href) 6259 for obj in objs: 6260 NetworkFilterParameterWriter.write_one(obj, writer, singular) 6261 writer.write_end()
6264class NetworkLabelWriter(Writer): 6265 6266 def __init__(self): 6267 super(NetworkLabelWriter, self).__init__() 6268 6269 @staticmethod 6270 def write_one(obj, writer, singular=None): 6271 if singular is None: 6272 singular = 'network_label' 6273 writer.write_start(singular) 6274 href = obj.href 6275 if href is not None: 6276 writer.write_attribute('href', href) 6277 if obj.id is not None: 6278 writer.write_attribute('id', obj.id) 6279 if obj.comment is not None: 6280 Writer.write_string(writer, 'comment', obj.comment) 6281 if obj.description is not None: 6282 Writer.write_string(writer, 'description', obj.description) 6283 if obj.name is not None: 6284 Writer.write_string(writer, 'name', obj.name) 6285 if obj.host_nic is not None: 6286 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 6287 if obj.network is not None: 6288 NetworkWriter.write_one(obj.network, writer, 'network') 6289 writer.write_end() 6290 6291 @staticmethod 6292 def write_many(objs, writer, singular=None, plural=None): 6293 if singular is None: 6294 singular = 'network_label' 6295 if plural is None: 6296 plural = 'network_labels' 6297 writer.write_start(plural) 6298 if isinstance(objs, List): 6299 href = objs.href 6300 if href is not None: 6301 writer.write_attribute('href', href) 6302 for obj in objs: 6303 NetworkLabelWriter.write_one(obj, writer, singular) 6304 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6269 @staticmethod 6270 def write_one(obj, writer, singular=None): 6271 if singular is None: 6272 singular = 'network_label' 6273 writer.write_start(singular) 6274 href = obj.href 6275 if href is not None: 6276 writer.write_attribute('href', href) 6277 if obj.id is not None: 6278 writer.write_attribute('id', obj.id) 6279 if obj.comment is not None: 6280 Writer.write_string(writer, 'comment', obj.comment) 6281 if obj.description is not None: 6282 Writer.write_string(writer, 'description', obj.description) 6283 if obj.name is not None: 6284 Writer.write_string(writer, 'name', obj.name) 6285 if obj.host_nic is not None: 6286 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 6287 if obj.network is not None: 6288 NetworkWriter.write_one(obj.network, writer, 'network') 6289 writer.write_end()
6291 @staticmethod 6292 def write_many(objs, writer, singular=None, plural=None): 6293 if singular is None: 6294 singular = 'network_label' 6295 if plural is None: 6296 plural = 'network_labels' 6297 writer.write_start(plural) 6298 if isinstance(objs, List): 6299 href = objs.href 6300 if href is not None: 6301 writer.write_attribute('href', href) 6302 for obj in objs: 6303 NetworkLabelWriter.write_one(obj, writer, singular) 6304 writer.write_end()
6307class NfsProfileDetailWriter(Writer): 6308 6309 def __init__(self): 6310 super(NfsProfileDetailWriter, self).__init__() 6311 6312 @staticmethod 6313 def write_one(obj, writer, singular=None): 6314 if singular is None: 6315 singular = 'nfs_profile_detail' 6316 writer.write_start(singular) 6317 href = obj.href 6318 if href is not None: 6319 writer.write_attribute('href', href) 6320 if obj.nfs_server_ip is not None: 6321 Writer.write_string(writer, 'nfs_server_ip', obj.nfs_server_ip) 6322 if obj.profile_details is not None: 6323 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 6324 writer.write_end() 6325 6326 @staticmethod 6327 def write_many(objs, writer, singular=None, plural=None): 6328 if singular is None: 6329 singular = 'nfs_profile_detail' 6330 if plural is None: 6331 plural = 'nfs_profile_details' 6332 writer.write_start(plural) 6333 if isinstance(objs, List): 6334 href = objs.href 6335 if href is not None: 6336 writer.write_attribute('href', href) 6337 for obj in objs: 6338 NfsProfileDetailWriter.write_one(obj, writer, singular) 6339 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6312 @staticmethod 6313 def write_one(obj, writer, singular=None): 6314 if singular is None: 6315 singular = 'nfs_profile_detail' 6316 writer.write_start(singular) 6317 href = obj.href 6318 if href is not None: 6319 writer.write_attribute('href', href) 6320 if obj.nfs_server_ip is not None: 6321 Writer.write_string(writer, 'nfs_server_ip', obj.nfs_server_ip) 6322 if obj.profile_details is not None: 6323 ProfileDetailWriter.write_many(obj.profile_details, writer, 'profile_detail', 'profile_details') 6324 writer.write_end()
6326 @staticmethod 6327 def write_many(objs, writer, singular=None, plural=None): 6328 if singular is None: 6329 singular = 'nfs_profile_detail' 6330 if plural is None: 6331 plural = 'nfs_profile_details' 6332 writer.write_start(plural) 6333 if isinstance(objs, List): 6334 href = objs.href 6335 if href is not None: 6336 writer.write_attribute('href', href) 6337 for obj in objs: 6338 NfsProfileDetailWriter.write_one(obj, writer, singular) 6339 writer.write_end()
6342class NicWriter(Writer): 6343 6344 def __init__(self): 6345 super(NicWriter, self).__init__() 6346 6347 @staticmethod 6348 def write_one(obj, writer, singular=None): 6349 if singular is None: 6350 singular = 'nic' 6351 writer.write_start(singular) 6352 href = obj.href 6353 if href is not None: 6354 writer.write_attribute('href', href) 6355 if obj.id is not None: 6356 writer.write_attribute('id', obj.id) 6357 if obj.boot_protocol is not None: 6358 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 6359 if obj.comment is not None: 6360 Writer.write_string(writer, 'comment', obj.comment) 6361 if obj.description is not None: 6362 Writer.write_string(writer, 'description', obj.description) 6363 if obj.interface is not None: 6364 Writer.write_string(writer, 'interface', obj.interface.value) 6365 if obj.linked is not None: 6366 Writer.write_boolean(writer, 'linked', obj.linked) 6367 if obj.mac is not None: 6368 MacWriter.write_one(obj.mac, writer, 'mac') 6369 if obj.name is not None: 6370 Writer.write_string(writer, 'name', obj.name) 6371 if obj.on_boot is not None: 6372 Writer.write_boolean(writer, 'on_boot', obj.on_boot) 6373 if obj.plugged is not None: 6374 Writer.write_boolean(writer, 'plugged', obj.plugged) 6375 if obj.synced is not None: 6376 Writer.write_boolean(writer, 'synced', obj.synced) 6377 if obj.instance_type is not None: 6378 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 6379 if obj.network is not None: 6380 NetworkWriter.write_one(obj.network, writer, 'network') 6381 if obj.network_attachments is not None: 6382 NetworkAttachmentWriter.write_many(obj.network_attachments, writer, 'network_attachment', 'network_attachments') 6383 if obj.network_filter_parameters is not None: 6384 NetworkFilterParameterWriter.write_many(obj.network_filter_parameters, writer, 'network_filter_parameter', 'network_filter_parameters') 6385 if obj.network_labels is not None: 6386 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 6387 if obj.reported_devices is not None: 6388 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 6389 if obj.statistics is not None: 6390 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 6391 if obj.template is not None: 6392 TemplateWriter.write_one(obj.template, writer, 'template') 6393 if obj.virtual_function_allowed_labels is not None: 6394 NetworkLabelWriter.write_many(obj.virtual_function_allowed_labels, writer, 'network_label', 'virtual_function_allowed_labels') 6395 if obj.virtual_function_allowed_networks is not None: 6396 NetworkWriter.write_many(obj.virtual_function_allowed_networks, writer, 'network', 'virtual_function_allowed_networks') 6397 if obj.vm is not None: 6398 VmWriter.write_one(obj.vm, writer, 'vm') 6399 if obj.vms is not None: 6400 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 6401 if obj.vnic_profile is not None: 6402 VnicProfileWriter.write_one(obj.vnic_profile, writer, 'vnic_profile') 6403 writer.write_end() 6404 6405 @staticmethod 6406 def write_many(objs, writer, singular=None, plural=None): 6407 if singular is None: 6408 singular = 'nic' 6409 if plural is None: 6410 plural = 'nics' 6411 writer.write_start(plural) 6412 if isinstance(objs, List): 6413 href = objs.href 6414 if href is not None: 6415 writer.write_attribute('href', href) 6416 for obj in objs: 6417 NicWriter.write_one(obj, writer, singular) 6418 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6347 @staticmethod 6348 def write_one(obj, writer, singular=None): 6349 if singular is None: 6350 singular = 'nic' 6351 writer.write_start(singular) 6352 href = obj.href 6353 if href is not None: 6354 writer.write_attribute('href', href) 6355 if obj.id is not None: 6356 writer.write_attribute('id', obj.id) 6357 if obj.boot_protocol is not None: 6358 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 6359 if obj.comment is not None: 6360 Writer.write_string(writer, 'comment', obj.comment) 6361 if obj.description is not None: 6362 Writer.write_string(writer, 'description', obj.description) 6363 if obj.interface is not None: 6364 Writer.write_string(writer, 'interface', obj.interface.value) 6365 if obj.linked is not None: 6366 Writer.write_boolean(writer, 'linked', obj.linked) 6367 if obj.mac is not None: 6368 MacWriter.write_one(obj.mac, writer, 'mac') 6369 if obj.name is not None: 6370 Writer.write_string(writer, 'name', obj.name) 6371 if obj.on_boot is not None: 6372 Writer.write_boolean(writer, 'on_boot', obj.on_boot) 6373 if obj.plugged is not None: 6374 Writer.write_boolean(writer, 'plugged', obj.plugged) 6375 if obj.synced is not None: 6376 Writer.write_boolean(writer, 'synced', obj.synced) 6377 if obj.instance_type is not None: 6378 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 6379 if obj.network is not None: 6380 NetworkWriter.write_one(obj.network, writer, 'network') 6381 if obj.network_attachments is not None: 6382 NetworkAttachmentWriter.write_many(obj.network_attachments, writer, 'network_attachment', 'network_attachments') 6383 if obj.network_filter_parameters is not None: 6384 NetworkFilterParameterWriter.write_many(obj.network_filter_parameters, writer, 'network_filter_parameter', 'network_filter_parameters') 6385 if obj.network_labels is not None: 6386 NetworkLabelWriter.write_many(obj.network_labels, writer, 'network_label', 'network_labels') 6387 if obj.reported_devices is not None: 6388 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 6389 if obj.statistics is not None: 6390 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 6391 if obj.template is not None: 6392 TemplateWriter.write_one(obj.template, writer, 'template') 6393 if obj.virtual_function_allowed_labels is not None: 6394 NetworkLabelWriter.write_many(obj.virtual_function_allowed_labels, writer, 'network_label', 'virtual_function_allowed_labels') 6395 if obj.virtual_function_allowed_networks is not None: 6396 NetworkWriter.write_many(obj.virtual_function_allowed_networks, writer, 'network', 'virtual_function_allowed_networks') 6397 if obj.vm is not None: 6398 VmWriter.write_one(obj.vm, writer, 'vm') 6399 if obj.vms is not None: 6400 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 6401 if obj.vnic_profile is not None: 6402 VnicProfileWriter.write_one(obj.vnic_profile, writer, 'vnic_profile') 6403 writer.write_end()
6405 @staticmethod 6406 def write_many(objs, writer, singular=None, plural=None): 6407 if singular is None: 6408 singular = 'nic' 6409 if plural is None: 6410 plural = 'nics' 6411 writer.write_start(plural) 6412 if isinstance(objs, List): 6413 href = objs.href 6414 if href is not None: 6415 writer.write_attribute('href', href) 6416 for obj in objs: 6417 NicWriter.write_one(obj, writer, singular) 6418 writer.write_end()
6421class NicConfigurationWriter(Writer): 6422 6423 def __init__(self): 6424 super(NicConfigurationWriter, self).__init__() 6425 6426 @staticmethod 6427 def write_one(obj, writer, singular=None): 6428 if singular is None: 6429 singular = 'nic_configuration' 6430 writer.write_start(singular) 6431 href = obj.href 6432 if href is not None: 6433 writer.write_attribute('href', href) 6434 if obj.boot_protocol is not None: 6435 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 6436 if obj.ip is not None: 6437 IpWriter.write_one(obj.ip, writer, 'ip') 6438 if obj.ipv6 is not None: 6439 IpWriter.write_one(obj.ipv6, writer, 'ipv6') 6440 if obj.ipv6_boot_protocol is not None: 6441 Writer.write_string(writer, 'ipv6_boot_protocol', obj.ipv6_boot_protocol.value) 6442 if obj.name is not None: 6443 Writer.write_string(writer, 'name', obj.name) 6444 if obj.on_boot is not None: 6445 Writer.write_boolean(writer, 'on_boot', obj.on_boot) 6446 writer.write_end() 6447 6448 @staticmethod 6449 def write_many(objs, writer, singular=None, plural=None): 6450 if singular is None: 6451 singular = 'nic_configuration' 6452 if plural is None: 6453 plural = 'nic_configurations' 6454 writer.write_start(plural) 6455 if isinstance(objs, List): 6456 href = objs.href 6457 if href is not None: 6458 writer.write_attribute('href', href) 6459 for obj in objs: 6460 NicConfigurationWriter.write_one(obj, writer, singular) 6461 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6426 @staticmethod 6427 def write_one(obj, writer, singular=None): 6428 if singular is None: 6429 singular = 'nic_configuration' 6430 writer.write_start(singular) 6431 href = obj.href 6432 if href is not None: 6433 writer.write_attribute('href', href) 6434 if obj.boot_protocol is not None: 6435 Writer.write_string(writer, 'boot_protocol', obj.boot_protocol.value) 6436 if obj.ip is not None: 6437 IpWriter.write_one(obj.ip, writer, 'ip') 6438 if obj.ipv6 is not None: 6439 IpWriter.write_one(obj.ipv6, writer, 'ipv6') 6440 if obj.ipv6_boot_protocol is not None: 6441 Writer.write_string(writer, 'ipv6_boot_protocol', obj.ipv6_boot_protocol.value) 6442 if obj.name is not None: 6443 Writer.write_string(writer, 'name', obj.name) 6444 if obj.on_boot is not None: 6445 Writer.write_boolean(writer, 'on_boot', obj.on_boot) 6446 writer.write_end()
6448 @staticmethod 6449 def write_many(objs, writer, singular=None, plural=None): 6450 if singular is None: 6451 singular = 'nic_configuration' 6452 if plural is None: 6453 plural = 'nic_configurations' 6454 writer.write_start(plural) 6455 if isinstance(objs, List): 6456 href = objs.href 6457 if href is not None: 6458 writer.write_attribute('href', href) 6459 for obj in objs: 6460 NicConfigurationWriter.write_one(obj, writer, singular) 6461 writer.write_end()
6464class NumaNodeWriter(Writer): 6465 6466 def __init__(self): 6467 super(NumaNodeWriter, self).__init__() 6468 6469 @staticmethod 6470 def write_one(obj, writer, singular=None): 6471 if singular is None: 6472 singular = 'host_numa_node' 6473 writer.write_start(singular) 6474 href = obj.href 6475 if href is not None: 6476 writer.write_attribute('href', href) 6477 if obj.id is not None: 6478 writer.write_attribute('id', obj.id) 6479 if obj.comment is not None: 6480 Writer.write_string(writer, 'comment', obj.comment) 6481 if obj.cpu is not None: 6482 CpuWriter.write_one(obj.cpu, writer, 'cpu') 6483 if obj.description is not None: 6484 Writer.write_string(writer, 'description', obj.description) 6485 if obj.index is not None: 6486 Writer.write_integer(writer, 'index', obj.index) 6487 if obj.memory is not None: 6488 Writer.write_integer(writer, 'memory', obj.memory) 6489 if obj.name is not None: 6490 Writer.write_string(writer, 'name', obj.name) 6491 if obj.node_distance is not None: 6492 Writer.write_string(writer, 'node_distance', obj.node_distance) 6493 if obj.host is not None: 6494 HostWriter.write_one(obj.host, writer, 'host') 6495 if obj.statistics is not None: 6496 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 6497 writer.write_end() 6498 6499 @staticmethod 6500 def write_many(objs, writer, singular=None, plural=None): 6501 if singular is None: 6502 singular = 'host_numa_node' 6503 if plural is None: 6504 plural = 'host_numa_nodes' 6505 writer.write_start(plural) 6506 if isinstance(objs, List): 6507 href = objs.href 6508 if href is not None: 6509 writer.write_attribute('href', href) 6510 for obj in objs: 6511 NumaNodeWriter.write_one(obj, writer, singular) 6512 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6469 @staticmethod 6470 def write_one(obj, writer, singular=None): 6471 if singular is None: 6472 singular = 'host_numa_node' 6473 writer.write_start(singular) 6474 href = obj.href 6475 if href is not None: 6476 writer.write_attribute('href', href) 6477 if obj.id is not None: 6478 writer.write_attribute('id', obj.id) 6479 if obj.comment is not None: 6480 Writer.write_string(writer, 'comment', obj.comment) 6481 if obj.cpu is not None: 6482 CpuWriter.write_one(obj.cpu, writer, 'cpu') 6483 if obj.description is not None: 6484 Writer.write_string(writer, 'description', obj.description) 6485 if obj.index is not None: 6486 Writer.write_integer(writer, 'index', obj.index) 6487 if obj.memory is not None: 6488 Writer.write_integer(writer, 'memory', obj.memory) 6489 if obj.name is not None: 6490 Writer.write_string(writer, 'name', obj.name) 6491 if obj.node_distance is not None: 6492 Writer.write_string(writer, 'node_distance', obj.node_distance) 6493 if obj.host is not None: 6494 HostWriter.write_one(obj.host, writer, 'host') 6495 if obj.statistics is not None: 6496 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 6497 writer.write_end()
6499 @staticmethod 6500 def write_many(objs, writer, singular=None, plural=None): 6501 if singular is None: 6502 singular = 'host_numa_node' 6503 if plural is None: 6504 plural = 'host_numa_nodes' 6505 writer.write_start(plural) 6506 if isinstance(objs, List): 6507 href = objs.href 6508 if href is not None: 6509 writer.write_attribute('href', href) 6510 for obj in objs: 6511 NumaNodeWriter.write_one(obj, writer, singular) 6512 writer.write_end()
6515class NumaNodePinWriter(Writer): 6516 6517 def __init__(self): 6518 super(NumaNodePinWriter, self).__init__() 6519 6520 @staticmethod 6521 def write_one(obj, writer, singular=None): 6522 if singular is None: 6523 singular = 'numa_node_pin' 6524 writer.write_start(singular) 6525 href = obj.href 6526 if href is not None: 6527 writer.write_attribute('href', href) 6528 if obj.host_numa_node is not None: 6529 NumaNodeWriter.write_one(obj.host_numa_node, writer, 'host_numa_node') 6530 if obj.index is not None: 6531 Writer.write_integer(writer, 'index', obj.index) 6532 if obj.pinned is not None: 6533 Writer.write_boolean(writer, 'pinned', obj.pinned) 6534 writer.write_end() 6535 6536 @staticmethod 6537 def write_many(objs, writer, singular=None, plural=None): 6538 if singular is None: 6539 singular = 'numa_node_pin' 6540 if plural is None: 6541 plural = 'numa_node_pins' 6542 writer.write_start(plural) 6543 if isinstance(objs, List): 6544 href = objs.href 6545 if href is not None: 6546 writer.write_attribute('href', href) 6547 for obj in objs: 6548 NumaNodePinWriter.write_one(obj, writer, singular) 6549 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6520 @staticmethod 6521 def write_one(obj, writer, singular=None): 6522 if singular is None: 6523 singular = 'numa_node_pin' 6524 writer.write_start(singular) 6525 href = obj.href 6526 if href is not None: 6527 writer.write_attribute('href', href) 6528 if obj.host_numa_node is not None: 6529 NumaNodeWriter.write_one(obj.host_numa_node, writer, 'host_numa_node') 6530 if obj.index is not None: 6531 Writer.write_integer(writer, 'index', obj.index) 6532 if obj.pinned is not None: 6533 Writer.write_boolean(writer, 'pinned', obj.pinned) 6534 writer.write_end()
6536 @staticmethod 6537 def write_many(objs, writer, singular=None, plural=None): 6538 if singular is None: 6539 singular = 'numa_node_pin' 6540 if plural is None: 6541 plural = 'numa_node_pins' 6542 writer.write_start(plural) 6543 if isinstance(objs, List): 6544 href = objs.href 6545 if href is not None: 6546 writer.write_attribute('href', href) 6547 for obj in objs: 6548 NumaNodePinWriter.write_one(obj, writer, singular) 6549 writer.write_end()
6552class OpenStackImageWriter(Writer): 6553 6554 def __init__(self): 6555 super(OpenStackImageWriter, self).__init__() 6556 6557 @staticmethod 6558 def write_one(obj, writer, singular=None): 6559 if singular is None: 6560 singular = 'openstack_image' 6561 writer.write_start(singular) 6562 href = obj.href 6563 if href is not None: 6564 writer.write_attribute('href', href) 6565 if obj.id is not None: 6566 writer.write_attribute('id', obj.id) 6567 if obj.comment is not None: 6568 Writer.write_string(writer, 'comment', obj.comment) 6569 if obj.description is not None: 6570 Writer.write_string(writer, 'description', obj.description) 6571 if obj.name is not None: 6572 Writer.write_string(writer, 'name', obj.name) 6573 if obj.openstack_image_provider is not None: 6574 OpenStackImageProviderWriter.write_one(obj.openstack_image_provider, writer, 'openstack_image_provider') 6575 writer.write_end() 6576 6577 @staticmethod 6578 def write_many(objs, writer, singular=None, plural=None): 6579 if singular is None: 6580 singular = 'openstack_image' 6581 if plural is None: 6582 plural = 'openstack_images' 6583 writer.write_start(plural) 6584 if isinstance(objs, List): 6585 href = objs.href 6586 if href is not None: 6587 writer.write_attribute('href', href) 6588 for obj in objs: 6589 OpenStackImageWriter.write_one(obj, writer, singular) 6590 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6557 @staticmethod 6558 def write_one(obj, writer, singular=None): 6559 if singular is None: 6560 singular = 'openstack_image' 6561 writer.write_start(singular) 6562 href = obj.href 6563 if href is not None: 6564 writer.write_attribute('href', href) 6565 if obj.id is not None: 6566 writer.write_attribute('id', obj.id) 6567 if obj.comment is not None: 6568 Writer.write_string(writer, 'comment', obj.comment) 6569 if obj.description is not None: 6570 Writer.write_string(writer, 'description', obj.description) 6571 if obj.name is not None: 6572 Writer.write_string(writer, 'name', obj.name) 6573 if obj.openstack_image_provider is not None: 6574 OpenStackImageProviderWriter.write_one(obj.openstack_image_provider, writer, 'openstack_image_provider') 6575 writer.write_end()
6577 @staticmethod 6578 def write_many(objs, writer, singular=None, plural=None): 6579 if singular is None: 6580 singular = 'openstack_image' 6581 if plural is None: 6582 plural = 'openstack_images' 6583 writer.write_start(plural) 6584 if isinstance(objs, List): 6585 href = objs.href 6586 if href is not None: 6587 writer.write_attribute('href', href) 6588 for obj in objs: 6589 OpenStackImageWriter.write_one(obj, writer, singular) 6590 writer.write_end()
6593class OpenStackImageProviderWriter(Writer): 6594 6595 def __init__(self): 6596 super(OpenStackImageProviderWriter, self).__init__() 6597 6598 @staticmethod 6599 def write_one(obj, writer, singular=None): 6600 if singular is None: 6601 singular = 'openstack_image_provider' 6602 writer.write_start(singular) 6603 href = obj.href 6604 if href is not None: 6605 writer.write_attribute('href', href) 6606 if obj.id is not None: 6607 writer.write_attribute('id', obj.id) 6608 if obj.authentication_url is not None: 6609 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6610 if obj.comment is not None: 6611 Writer.write_string(writer, 'comment', obj.comment) 6612 if obj.description is not None: 6613 Writer.write_string(writer, 'description', obj.description) 6614 if obj.name is not None: 6615 Writer.write_string(writer, 'name', obj.name) 6616 if obj.password is not None: 6617 Writer.write_string(writer, 'password', obj.password) 6618 if obj.properties is not None: 6619 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6620 if obj.requires_authentication is not None: 6621 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6622 if obj.tenant_name is not None: 6623 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6624 if obj.url is not None: 6625 Writer.write_string(writer, 'url', obj.url) 6626 if obj.username is not None: 6627 Writer.write_string(writer, 'username', obj.username) 6628 if obj.certificates is not None: 6629 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6630 if obj.images is not None: 6631 OpenStackImageWriter.write_many(obj.images, writer, 'openstack_image', 'images') 6632 writer.write_end() 6633 6634 @staticmethod 6635 def write_many(objs, writer, singular=None, plural=None): 6636 if singular is None: 6637 singular = 'openstack_image_provider' 6638 if plural is None: 6639 plural = 'openstack_image_providers' 6640 writer.write_start(plural) 6641 if isinstance(objs, List): 6642 href = objs.href 6643 if href is not None: 6644 writer.write_attribute('href', href) 6645 for obj in objs: 6646 OpenStackImageProviderWriter.write_one(obj, writer, singular) 6647 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6598 @staticmethod 6599 def write_one(obj, writer, singular=None): 6600 if singular is None: 6601 singular = 'openstack_image_provider' 6602 writer.write_start(singular) 6603 href = obj.href 6604 if href is not None: 6605 writer.write_attribute('href', href) 6606 if obj.id is not None: 6607 writer.write_attribute('id', obj.id) 6608 if obj.authentication_url is not None: 6609 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6610 if obj.comment is not None: 6611 Writer.write_string(writer, 'comment', obj.comment) 6612 if obj.description is not None: 6613 Writer.write_string(writer, 'description', obj.description) 6614 if obj.name is not None: 6615 Writer.write_string(writer, 'name', obj.name) 6616 if obj.password is not None: 6617 Writer.write_string(writer, 'password', obj.password) 6618 if obj.properties is not None: 6619 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6620 if obj.requires_authentication is not None: 6621 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6622 if obj.tenant_name is not None: 6623 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6624 if obj.url is not None: 6625 Writer.write_string(writer, 'url', obj.url) 6626 if obj.username is not None: 6627 Writer.write_string(writer, 'username', obj.username) 6628 if obj.certificates is not None: 6629 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6630 if obj.images is not None: 6631 OpenStackImageWriter.write_many(obj.images, writer, 'openstack_image', 'images') 6632 writer.write_end()
6634 @staticmethod 6635 def write_many(objs, writer, singular=None, plural=None): 6636 if singular is None: 6637 singular = 'openstack_image_provider' 6638 if plural is None: 6639 plural = 'openstack_image_providers' 6640 writer.write_start(plural) 6641 if isinstance(objs, List): 6642 href = objs.href 6643 if href is not None: 6644 writer.write_attribute('href', href) 6645 for obj in objs: 6646 OpenStackImageProviderWriter.write_one(obj, writer, singular) 6647 writer.write_end()
6650class OpenStackNetworkWriter(Writer): 6651 6652 def __init__(self): 6653 super(OpenStackNetworkWriter, self).__init__() 6654 6655 @staticmethod 6656 def write_one(obj, writer, singular=None): 6657 if singular is None: 6658 singular = 'openstack_network' 6659 writer.write_start(singular) 6660 href = obj.href 6661 if href is not None: 6662 writer.write_attribute('href', href) 6663 if obj.id is not None: 6664 writer.write_attribute('id', obj.id) 6665 if obj.comment is not None: 6666 Writer.write_string(writer, 'comment', obj.comment) 6667 if obj.description is not None: 6668 Writer.write_string(writer, 'description', obj.description) 6669 if obj.name is not None: 6670 Writer.write_string(writer, 'name', obj.name) 6671 if obj.openstack_network_provider is not None: 6672 OpenStackNetworkProviderWriter.write_one(obj.openstack_network_provider, writer, 'openstack_network_provider') 6673 writer.write_end() 6674 6675 @staticmethod 6676 def write_many(objs, writer, singular=None, plural=None): 6677 if singular is None: 6678 singular = 'openstack_network' 6679 if plural is None: 6680 plural = 'openstack_networks' 6681 writer.write_start(plural) 6682 if isinstance(objs, List): 6683 href = objs.href 6684 if href is not None: 6685 writer.write_attribute('href', href) 6686 for obj in objs: 6687 OpenStackNetworkWriter.write_one(obj, writer, singular) 6688 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6655 @staticmethod 6656 def write_one(obj, writer, singular=None): 6657 if singular is None: 6658 singular = 'openstack_network' 6659 writer.write_start(singular) 6660 href = obj.href 6661 if href is not None: 6662 writer.write_attribute('href', href) 6663 if obj.id is not None: 6664 writer.write_attribute('id', obj.id) 6665 if obj.comment is not None: 6666 Writer.write_string(writer, 'comment', obj.comment) 6667 if obj.description is not None: 6668 Writer.write_string(writer, 'description', obj.description) 6669 if obj.name is not None: 6670 Writer.write_string(writer, 'name', obj.name) 6671 if obj.openstack_network_provider is not None: 6672 OpenStackNetworkProviderWriter.write_one(obj.openstack_network_provider, writer, 'openstack_network_provider') 6673 writer.write_end()
6675 @staticmethod 6676 def write_many(objs, writer, singular=None, plural=None): 6677 if singular is None: 6678 singular = 'openstack_network' 6679 if plural is None: 6680 plural = 'openstack_networks' 6681 writer.write_start(plural) 6682 if isinstance(objs, List): 6683 href = objs.href 6684 if href is not None: 6685 writer.write_attribute('href', href) 6686 for obj in objs: 6687 OpenStackNetworkWriter.write_one(obj, writer, singular) 6688 writer.write_end()
6691class OpenStackNetworkProviderWriter(Writer): 6692 6693 def __init__(self): 6694 super(OpenStackNetworkProviderWriter, self).__init__() 6695 6696 @staticmethod 6697 def write_one(obj, writer, singular=None): 6698 if singular is None: 6699 singular = 'openstack_network_provider' 6700 writer.write_start(singular) 6701 href = obj.href 6702 if href is not None: 6703 writer.write_attribute('href', href) 6704 if obj.id is not None: 6705 writer.write_attribute('id', obj.id) 6706 if obj.agent_configuration is not None: 6707 AgentConfigurationWriter.write_one(obj.agent_configuration, writer, 'agent_configuration') 6708 if obj.authentication_url is not None: 6709 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6710 if obj.auto_sync is not None: 6711 Writer.write_boolean(writer, 'auto_sync', obj.auto_sync) 6712 if obj.comment is not None: 6713 Writer.write_string(writer, 'comment', obj.comment) 6714 if obj.description is not None: 6715 Writer.write_string(writer, 'description', obj.description) 6716 if obj.external_plugin_type is not None: 6717 Writer.write_string(writer, 'external_plugin_type', obj.external_plugin_type) 6718 if obj.name is not None: 6719 Writer.write_string(writer, 'name', obj.name) 6720 if obj.password is not None: 6721 Writer.write_string(writer, 'password', obj.password) 6722 if obj.plugin_type is not None: 6723 Writer.write_string(writer, 'plugin_type', obj.plugin_type.value) 6724 if obj.project_domain_name is not None: 6725 Writer.write_string(writer, 'project_domain_name', obj.project_domain_name) 6726 if obj.project_name is not None: 6727 Writer.write_string(writer, 'project_name', obj.project_name) 6728 if obj.properties is not None: 6729 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6730 if obj.read_only is not None: 6731 Writer.write_boolean(writer, 'read_only', obj.read_only) 6732 if obj.requires_authentication is not None: 6733 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6734 if obj.tenant_name is not None: 6735 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6736 if obj.type is not None: 6737 Writer.write_string(writer, 'type', obj.type.value) 6738 if obj.unmanaged is not None: 6739 Writer.write_boolean(writer, 'unmanaged', obj.unmanaged) 6740 if obj.url is not None: 6741 Writer.write_string(writer, 'url', obj.url) 6742 if obj.user_domain_name is not None: 6743 Writer.write_string(writer, 'user_domain_name', obj.user_domain_name) 6744 if obj.username is not None: 6745 Writer.write_string(writer, 'username', obj.username) 6746 if obj.certificates is not None: 6747 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6748 if obj.networks is not None: 6749 OpenStackNetworkWriter.write_many(obj.networks, writer, 'openstack_network', 'networks') 6750 if obj.subnets is not None: 6751 OpenStackSubnetWriter.write_many(obj.subnets, writer, 'openstack_subnet', 'subnets') 6752 writer.write_end() 6753 6754 @staticmethod 6755 def write_many(objs, writer, singular=None, plural=None): 6756 if singular is None: 6757 singular = 'openstack_network_provider' 6758 if plural is None: 6759 plural = 'openstack_network_providers' 6760 writer.write_start(plural) 6761 if isinstance(objs, List): 6762 href = objs.href 6763 if href is not None: 6764 writer.write_attribute('href', href) 6765 for obj in objs: 6766 OpenStackNetworkProviderWriter.write_one(obj, writer, singular) 6767 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6696 @staticmethod 6697 def write_one(obj, writer, singular=None): 6698 if singular is None: 6699 singular = 'openstack_network_provider' 6700 writer.write_start(singular) 6701 href = obj.href 6702 if href is not None: 6703 writer.write_attribute('href', href) 6704 if obj.id is not None: 6705 writer.write_attribute('id', obj.id) 6706 if obj.agent_configuration is not None: 6707 AgentConfigurationWriter.write_one(obj.agent_configuration, writer, 'agent_configuration') 6708 if obj.authentication_url is not None: 6709 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6710 if obj.auto_sync is not None: 6711 Writer.write_boolean(writer, 'auto_sync', obj.auto_sync) 6712 if obj.comment is not None: 6713 Writer.write_string(writer, 'comment', obj.comment) 6714 if obj.description is not None: 6715 Writer.write_string(writer, 'description', obj.description) 6716 if obj.external_plugin_type is not None: 6717 Writer.write_string(writer, 'external_plugin_type', obj.external_plugin_type) 6718 if obj.name is not None: 6719 Writer.write_string(writer, 'name', obj.name) 6720 if obj.password is not None: 6721 Writer.write_string(writer, 'password', obj.password) 6722 if obj.plugin_type is not None: 6723 Writer.write_string(writer, 'plugin_type', obj.plugin_type.value) 6724 if obj.project_domain_name is not None: 6725 Writer.write_string(writer, 'project_domain_name', obj.project_domain_name) 6726 if obj.project_name is not None: 6727 Writer.write_string(writer, 'project_name', obj.project_name) 6728 if obj.properties is not None: 6729 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6730 if obj.read_only is not None: 6731 Writer.write_boolean(writer, 'read_only', obj.read_only) 6732 if obj.requires_authentication is not None: 6733 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6734 if obj.tenant_name is not None: 6735 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6736 if obj.type is not None: 6737 Writer.write_string(writer, 'type', obj.type.value) 6738 if obj.unmanaged is not None: 6739 Writer.write_boolean(writer, 'unmanaged', obj.unmanaged) 6740 if obj.url is not None: 6741 Writer.write_string(writer, 'url', obj.url) 6742 if obj.user_domain_name is not None: 6743 Writer.write_string(writer, 'user_domain_name', obj.user_domain_name) 6744 if obj.username is not None: 6745 Writer.write_string(writer, 'username', obj.username) 6746 if obj.certificates is not None: 6747 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6748 if obj.networks is not None: 6749 OpenStackNetworkWriter.write_many(obj.networks, writer, 'openstack_network', 'networks') 6750 if obj.subnets is not None: 6751 OpenStackSubnetWriter.write_many(obj.subnets, writer, 'openstack_subnet', 'subnets') 6752 writer.write_end()
6754 @staticmethod 6755 def write_many(objs, writer, singular=None, plural=None): 6756 if singular is None: 6757 singular = 'openstack_network_provider' 6758 if plural is None: 6759 plural = 'openstack_network_providers' 6760 writer.write_start(plural) 6761 if isinstance(objs, List): 6762 href = objs.href 6763 if href is not None: 6764 writer.write_attribute('href', href) 6765 for obj in objs: 6766 OpenStackNetworkProviderWriter.write_one(obj, writer, singular) 6767 writer.write_end()
6770class OpenStackProviderWriter(Writer): 6771 6772 def __init__(self): 6773 super(OpenStackProviderWriter, self).__init__() 6774 6775 @staticmethod 6776 def write_one(obj, writer, singular=None): 6777 if singular is None: 6778 singular = 'open_stack_provider' 6779 writer.write_start(singular) 6780 href = obj.href 6781 if href is not None: 6782 writer.write_attribute('href', href) 6783 if obj.id is not None: 6784 writer.write_attribute('id', obj.id) 6785 if obj.authentication_url is not None: 6786 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6787 if obj.comment is not None: 6788 Writer.write_string(writer, 'comment', obj.comment) 6789 if obj.description is not None: 6790 Writer.write_string(writer, 'description', obj.description) 6791 if obj.name is not None: 6792 Writer.write_string(writer, 'name', obj.name) 6793 if obj.password is not None: 6794 Writer.write_string(writer, 'password', obj.password) 6795 if obj.properties is not None: 6796 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6797 if obj.requires_authentication is not None: 6798 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6799 if obj.tenant_name is not None: 6800 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6801 if obj.url is not None: 6802 Writer.write_string(writer, 'url', obj.url) 6803 if obj.username is not None: 6804 Writer.write_string(writer, 'username', obj.username) 6805 writer.write_end() 6806 6807 @staticmethod 6808 def write_many(objs, writer, singular=None, plural=None): 6809 if singular is None: 6810 singular = 'open_stack_provider' 6811 if plural is None: 6812 plural = 'open_stack_providers' 6813 writer.write_start(plural) 6814 if isinstance(objs, List): 6815 href = objs.href 6816 if href is not None: 6817 writer.write_attribute('href', href) 6818 for obj in objs: 6819 OpenStackProviderWriter.write_one(obj, writer, singular) 6820 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6775 @staticmethod 6776 def write_one(obj, writer, singular=None): 6777 if singular is None: 6778 singular = 'open_stack_provider' 6779 writer.write_start(singular) 6780 href = obj.href 6781 if href is not None: 6782 writer.write_attribute('href', href) 6783 if obj.id is not None: 6784 writer.write_attribute('id', obj.id) 6785 if obj.authentication_url is not None: 6786 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6787 if obj.comment is not None: 6788 Writer.write_string(writer, 'comment', obj.comment) 6789 if obj.description is not None: 6790 Writer.write_string(writer, 'description', obj.description) 6791 if obj.name is not None: 6792 Writer.write_string(writer, 'name', obj.name) 6793 if obj.password is not None: 6794 Writer.write_string(writer, 'password', obj.password) 6795 if obj.properties is not None: 6796 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6797 if obj.requires_authentication is not None: 6798 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6799 if obj.tenant_name is not None: 6800 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6801 if obj.url is not None: 6802 Writer.write_string(writer, 'url', obj.url) 6803 if obj.username is not None: 6804 Writer.write_string(writer, 'username', obj.username) 6805 writer.write_end()
6807 @staticmethod 6808 def write_many(objs, writer, singular=None, plural=None): 6809 if singular is None: 6810 singular = 'open_stack_provider' 6811 if plural is None: 6812 plural = 'open_stack_providers' 6813 writer.write_start(plural) 6814 if isinstance(objs, List): 6815 href = objs.href 6816 if href is not None: 6817 writer.write_attribute('href', href) 6818 for obj in objs: 6819 OpenStackProviderWriter.write_one(obj, writer, singular) 6820 writer.write_end()
6823class OpenStackSubnetWriter(Writer): 6824 6825 def __init__(self): 6826 super(OpenStackSubnetWriter, self).__init__() 6827 6828 @staticmethod 6829 def write_one(obj, writer, singular=None): 6830 if singular is None: 6831 singular = 'openstack_subnet' 6832 writer.write_start(singular) 6833 href = obj.href 6834 if href is not None: 6835 writer.write_attribute('href', href) 6836 if obj.id is not None: 6837 writer.write_attribute('id', obj.id) 6838 if obj.cidr is not None: 6839 Writer.write_string(writer, 'cidr', obj.cidr) 6840 if obj.comment is not None: 6841 Writer.write_string(writer, 'comment', obj.comment) 6842 if obj.description is not None: 6843 Writer.write_string(writer, 'description', obj.description) 6844 if obj.dns_servers is not None: 6845 writer.write_start('dns_servers') 6846 for item in obj.dns_servers: 6847 if item is not None: 6848 Writer.write_string(writer, 'dns_server', item) 6849 writer.write_end() 6850 if obj.gateway is not None: 6851 Writer.write_string(writer, 'gateway', obj.gateway) 6852 if obj.ip_version is not None: 6853 Writer.write_string(writer, 'ip_version', obj.ip_version) 6854 if obj.name is not None: 6855 Writer.write_string(writer, 'name', obj.name) 6856 if obj.openstack_network is not None: 6857 OpenStackNetworkWriter.write_one(obj.openstack_network, writer, 'openstack_network') 6858 writer.write_end() 6859 6860 @staticmethod 6861 def write_many(objs, writer, singular=None, plural=None): 6862 if singular is None: 6863 singular = 'openstack_subnet' 6864 if plural is None: 6865 plural = 'openstack_subnets' 6866 writer.write_start(plural) 6867 if isinstance(objs, List): 6868 href = objs.href 6869 if href is not None: 6870 writer.write_attribute('href', href) 6871 for obj in objs: 6872 OpenStackSubnetWriter.write_one(obj, writer, singular) 6873 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6828 @staticmethod 6829 def write_one(obj, writer, singular=None): 6830 if singular is None: 6831 singular = 'openstack_subnet' 6832 writer.write_start(singular) 6833 href = obj.href 6834 if href is not None: 6835 writer.write_attribute('href', href) 6836 if obj.id is not None: 6837 writer.write_attribute('id', obj.id) 6838 if obj.cidr is not None: 6839 Writer.write_string(writer, 'cidr', obj.cidr) 6840 if obj.comment is not None: 6841 Writer.write_string(writer, 'comment', obj.comment) 6842 if obj.description is not None: 6843 Writer.write_string(writer, 'description', obj.description) 6844 if obj.dns_servers is not None: 6845 writer.write_start('dns_servers') 6846 for item in obj.dns_servers: 6847 if item is not None: 6848 Writer.write_string(writer, 'dns_server', item) 6849 writer.write_end() 6850 if obj.gateway is not None: 6851 Writer.write_string(writer, 'gateway', obj.gateway) 6852 if obj.ip_version is not None: 6853 Writer.write_string(writer, 'ip_version', obj.ip_version) 6854 if obj.name is not None: 6855 Writer.write_string(writer, 'name', obj.name) 6856 if obj.openstack_network is not None: 6857 OpenStackNetworkWriter.write_one(obj.openstack_network, writer, 'openstack_network') 6858 writer.write_end()
6860 @staticmethod 6861 def write_many(objs, writer, singular=None, plural=None): 6862 if singular is None: 6863 singular = 'openstack_subnet' 6864 if plural is None: 6865 plural = 'openstack_subnets' 6866 writer.write_start(plural) 6867 if isinstance(objs, List): 6868 href = objs.href 6869 if href is not None: 6870 writer.write_attribute('href', href) 6871 for obj in objs: 6872 OpenStackSubnetWriter.write_one(obj, writer, singular) 6873 writer.write_end()
6876class OpenStackVolumeProviderWriter(Writer): 6877 6878 def __init__(self): 6879 super(OpenStackVolumeProviderWriter, self).__init__() 6880 6881 @staticmethod 6882 def write_one(obj, writer, singular=None): 6883 if singular is None: 6884 singular = 'openstack_volume_provider' 6885 writer.write_start(singular) 6886 href = obj.href 6887 if href is not None: 6888 writer.write_attribute('href', href) 6889 if obj.id is not None: 6890 writer.write_attribute('id', obj.id) 6891 if obj.authentication_url is not None: 6892 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6893 if obj.comment is not None: 6894 Writer.write_string(writer, 'comment', obj.comment) 6895 if obj.description is not None: 6896 Writer.write_string(writer, 'description', obj.description) 6897 if obj.name is not None: 6898 Writer.write_string(writer, 'name', obj.name) 6899 if obj.password is not None: 6900 Writer.write_string(writer, 'password', obj.password) 6901 if obj.properties is not None: 6902 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6903 if obj.requires_authentication is not None: 6904 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6905 if obj.tenant_name is not None: 6906 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6907 if obj.url is not None: 6908 Writer.write_string(writer, 'url', obj.url) 6909 if obj.username is not None: 6910 Writer.write_string(writer, 'username', obj.username) 6911 if obj.authentication_keys is not None: 6912 OpenstackVolumeAuthenticationKeyWriter.write_many(obj.authentication_keys, writer, 'openstack_volume_authentication_key', 'authentication_keys') 6913 if obj.certificates is not None: 6914 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6915 if obj.data_center is not None: 6916 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 6917 if obj.volume_types is not None: 6918 OpenStackVolumeTypeWriter.write_many(obj.volume_types, writer, 'open_stack_volume_type', 'volume_types') 6919 writer.write_end() 6920 6921 @staticmethod 6922 def write_many(objs, writer, singular=None, plural=None): 6923 if singular is None: 6924 singular = 'openstack_volume_provider' 6925 if plural is None: 6926 plural = 'openstack_volume_providers' 6927 writer.write_start(plural) 6928 if isinstance(objs, List): 6929 href = objs.href 6930 if href is not None: 6931 writer.write_attribute('href', href) 6932 for obj in objs: 6933 OpenStackVolumeProviderWriter.write_one(obj, writer, singular) 6934 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6881 @staticmethod 6882 def write_one(obj, writer, singular=None): 6883 if singular is None: 6884 singular = 'openstack_volume_provider' 6885 writer.write_start(singular) 6886 href = obj.href 6887 if href is not None: 6888 writer.write_attribute('href', href) 6889 if obj.id is not None: 6890 writer.write_attribute('id', obj.id) 6891 if obj.authentication_url is not None: 6892 Writer.write_string(writer, 'authentication_url', obj.authentication_url) 6893 if obj.comment is not None: 6894 Writer.write_string(writer, 'comment', obj.comment) 6895 if obj.description is not None: 6896 Writer.write_string(writer, 'description', obj.description) 6897 if obj.name is not None: 6898 Writer.write_string(writer, 'name', obj.name) 6899 if obj.password is not None: 6900 Writer.write_string(writer, 'password', obj.password) 6901 if obj.properties is not None: 6902 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6903 if obj.requires_authentication is not None: 6904 Writer.write_boolean(writer, 'requires_authentication', obj.requires_authentication) 6905 if obj.tenant_name is not None: 6906 Writer.write_string(writer, 'tenant_name', obj.tenant_name) 6907 if obj.url is not None: 6908 Writer.write_string(writer, 'url', obj.url) 6909 if obj.username is not None: 6910 Writer.write_string(writer, 'username', obj.username) 6911 if obj.authentication_keys is not None: 6912 OpenstackVolumeAuthenticationKeyWriter.write_many(obj.authentication_keys, writer, 'openstack_volume_authentication_key', 'authentication_keys') 6913 if obj.certificates is not None: 6914 CertificateWriter.write_many(obj.certificates, writer, 'certificate', 'certificates') 6915 if obj.data_center is not None: 6916 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 6917 if obj.volume_types is not None: 6918 OpenStackVolumeTypeWriter.write_many(obj.volume_types, writer, 'open_stack_volume_type', 'volume_types') 6919 writer.write_end()
6921 @staticmethod 6922 def write_many(objs, writer, singular=None, plural=None): 6923 if singular is None: 6924 singular = 'openstack_volume_provider' 6925 if plural is None: 6926 plural = 'openstack_volume_providers' 6927 writer.write_start(plural) 6928 if isinstance(objs, List): 6929 href = objs.href 6930 if href is not None: 6931 writer.write_attribute('href', href) 6932 for obj in objs: 6933 OpenStackVolumeProviderWriter.write_one(obj, writer, singular) 6934 writer.write_end()
6937class OpenStackVolumeTypeWriter(Writer): 6938 6939 def __init__(self): 6940 super(OpenStackVolumeTypeWriter, self).__init__() 6941 6942 @staticmethod 6943 def write_one(obj, writer, singular=None): 6944 if singular is None: 6945 singular = 'open_stack_volume_type' 6946 writer.write_start(singular) 6947 href = obj.href 6948 if href is not None: 6949 writer.write_attribute('href', href) 6950 if obj.id is not None: 6951 writer.write_attribute('id', obj.id) 6952 if obj.comment is not None: 6953 Writer.write_string(writer, 'comment', obj.comment) 6954 if obj.description is not None: 6955 Writer.write_string(writer, 'description', obj.description) 6956 if obj.name is not None: 6957 Writer.write_string(writer, 'name', obj.name) 6958 if obj.properties is not None: 6959 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6960 if obj.openstack_volume_provider is not None: 6961 OpenStackVolumeProviderWriter.write_one(obj.openstack_volume_provider, writer, 'openstack_volume_provider') 6962 writer.write_end() 6963 6964 @staticmethod 6965 def write_many(objs, writer, singular=None, plural=None): 6966 if singular is None: 6967 singular = 'open_stack_volume_type' 6968 if plural is None: 6969 plural = 'open_stack_volume_types' 6970 writer.write_start(plural) 6971 if isinstance(objs, List): 6972 href = objs.href 6973 if href is not None: 6974 writer.write_attribute('href', href) 6975 for obj in objs: 6976 OpenStackVolumeTypeWriter.write_one(obj, writer, singular) 6977 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6942 @staticmethod 6943 def write_one(obj, writer, singular=None): 6944 if singular is None: 6945 singular = 'open_stack_volume_type' 6946 writer.write_start(singular) 6947 href = obj.href 6948 if href is not None: 6949 writer.write_attribute('href', href) 6950 if obj.id is not None: 6951 writer.write_attribute('id', obj.id) 6952 if obj.comment is not None: 6953 Writer.write_string(writer, 'comment', obj.comment) 6954 if obj.description is not None: 6955 Writer.write_string(writer, 'description', obj.description) 6956 if obj.name is not None: 6957 Writer.write_string(writer, 'name', obj.name) 6958 if obj.properties is not None: 6959 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 6960 if obj.openstack_volume_provider is not None: 6961 OpenStackVolumeProviderWriter.write_one(obj.openstack_volume_provider, writer, 'openstack_volume_provider') 6962 writer.write_end()
6964 @staticmethod 6965 def write_many(objs, writer, singular=None, plural=None): 6966 if singular is None: 6967 singular = 'open_stack_volume_type' 6968 if plural is None: 6969 plural = 'open_stack_volume_types' 6970 writer.write_start(plural) 6971 if isinstance(objs, List): 6972 href = objs.href 6973 if href is not None: 6974 writer.write_attribute('href', href) 6975 for obj in objs: 6976 OpenStackVolumeTypeWriter.write_one(obj, writer, singular) 6977 writer.write_end()
6980class OpenstackVolumeAuthenticationKeyWriter(Writer): 6981 6982 def __init__(self): 6983 super(OpenstackVolumeAuthenticationKeyWriter, self).__init__() 6984 6985 @staticmethod 6986 def write_one(obj, writer, singular=None): 6987 if singular is None: 6988 singular = 'openstack_volume_authentication_key' 6989 writer.write_start(singular) 6990 href = obj.href 6991 if href is not None: 6992 writer.write_attribute('href', href) 6993 if obj.id is not None: 6994 writer.write_attribute('id', obj.id) 6995 if obj.comment is not None: 6996 Writer.write_string(writer, 'comment', obj.comment) 6997 if obj.creation_date is not None: 6998 Writer.write_date(writer, 'creation_date', obj.creation_date) 6999 if obj.description is not None: 7000 Writer.write_string(writer, 'description', obj.description) 7001 if obj.name is not None: 7002 Writer.write_string(writer, 'name', obj.name) 7003 if obj.usage_type is not None: 7004 Writer.write_string(writer, 'usage_type', obj.usage_type.value) 7005 if obj.uuid is not None: 7006 Writer.write_string(writer, 'uuid', obj.uuid) 7007 if obj.value is not None: 7008 Writer.write_string(writer, 'value', obj.value) 7009 if obj.openstack_volume_provider is not None: 7010 OpenStackVolumeProviderWriter.write_one(obj.openstack_volume_provider, writer, 'openstack_volume_provider') 7011 writer.write_end() 7012 7013 @staticmethod 7014 def write_many(objs, writer, singular=None, plural=None): 7015 if singular is None: 7016 singular = 'openstack_volume_authentication_key' 7017 if plural is None: 7018 plural = 'openstack_volume_authentication_keys' 7019 writer.write_start(plural) 7020 if isinstance(objs, List): 7021 href = objs.href 7022 if href is not None: 7023 writer.write_attribute('href', href) 7024 for obj in objs: 7025 OpenstackVolumeAuthenticationKeyWriter.write_one(obj, writer, singular) 7026 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
6985 @staticmethod 6986 def write_one(obj, writer, singular=None): 6987 if singular is None: 6988 singular = 'openstack_volume_authentication_key' 6989 writer.write_start(singular) 6990 href = obj.href 6991 if href is not None: 6992 writer.write_attribute('href', href) 6993 if obj.id is not None: 6994 writer.write_attribute('id', obj.id) 6995 if obj.comment is not None: 6996 Writer.write_string(writer, 'comment', obj.comment) 6997 if obj.creation_date is not None: 6998 Writer.write_date(writer, 'creation_date', obj.creation_date) 6999 if obj.description is not None: 7000 Writer.write_string(writer, 'description', obj.description) 7001 if obj.name is not None: 7002 Writer.write_string(writer, 'name', obj.name) 7003 if obj.usage_type is not None: 7004 Writer.write_string(writer, 'usage_type', obj.usage_type.value) 7005 if obj.uuid is not None: 7006 Writer.write_string(writer, 'uuid', obj.uuid) 7007 if obj.value is not None: 7008 Writer.write_string(writer, 'value', obj.value) 7009 if obj.openstack_volume_provider is not None: 7010 OpenStackVolumeProviderWriter.write_one(obj.openstack_volume_provider, writer, 'openstack_volume_provider') 7011 writer.write_end()
7013 @staticmethod 7014 def write_many(objs, writer, singular=None, plural=None): 7015 if singular is None: 7016 singular = 'openstack_volume_authentication_key' 7017 if plural is None: 7018 plural = 'openstack_volume_authentication_keys' 7019 writer.write_start(plural) 7020 if isinstance(objs, List): 7021 href = objs.href 7022 if href is not None: 7023 writer.write_attribute('href', href) 7024 for obj in objs: 7025 OpenstackVolumeAuthenticationKeyWriter.write_one(obj, writer, singular) 7026 writer.write_end()
7029class OperatingSystemWriter(Writer): 7030 7031 def __init__(self): 7032 super(OperatingSystemWriter, self).__init__() 7033 7034 @staticmethod 7035 def write_one(obj, writer, singular=None): 7036 if singular is None: 7037 singular = 'os' 7038 writer.write_start(singular) 7039 href = obj.href 7040 if href is not None: 7041 writer.write_attribute('href', href) 7042 if obj.boot is not None: 7043 BootWriter.write_one(obj.boot, writer, 'boot') 7044 if obj.cmdline is not None: 7045 Writer.write_string(writer, 'cmdline', obj.cmdline) 7046 if obj.custom_kernel_cmdline is not None: 7047 Writer.write_string(writer, 'custom_kernel_cmdline', obj.custom_kernel_cmdline) 7048 if obj.description is not None: 7049 Writer.write_string(writer, 'description', obj.description) 7050 if obj.initrd is not None: 7051 Writer.write_string(writer, 'initrd', obj.initrd) 7052 if obj.kernel is not None: 7053 Writer.write_string(writer, 'kernel', obj.kernel) 7054 if obj.reported_kernel_cmdline is not None: 7055 Writer.write_string(writer, 'reported_kernel_cmdline', obj.reported_kernel_cmdline) 7056 if obj.type is not None: 7057 Writer.write_string(writer, 'type', obj.type) 7058 if obj.version is not None: 7059 VersionWriter.write_one(obj.version, writer, 'version') 7060 writer.write_end() 7061 7062 @staticmethod 7063 def write_many(objs, writer, singular=None, plural=None): 7064 if singular is None: 7065 singular = 'os' 7066 if plural is None: 7067 plural = 'oss' 7068 writer.write_start(plural) 7069 if isinstance(objs, List): 7070 href = objs.href 7071 if href is not None: 7072 writer.write_attribute('href', href) 7073 for obj in objs: 7074 OperatingSystemWriter.write_one(obj, writer, singular) 7075 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7034 @staticmethod 7035 def write_one(obj, writer, singular=None): 7036 if singular is None: 7037 singular = 'os' 7038 writer.write_start(singular) 7039 href = obj.href 7040 if href is not None: 7041 writer.write_attribute('href', href) 7042 if obj.boot is not None: 7043 BootWriter.write_one(obj.boot, writer, 'boot') 7044 if obj.cmdline is not None: 7045 Writer.write_string(writer, 'cmdline', obj.cmdline) 7046 if obj.custom_kernel_cmdline is not None: 7047 Writer.write_string(writer, 'custom_kernel_cmdline', obj.custom_kernel_cmdline) 7048 if obj.description is not None: 7049 Writer.write_string(writer, 'description', obj.description) 7050 if obj.initrd is not None: 7051 Writer.write_string(writer, 'initrd', obj.initrd) 7052 if obj.kernel is not None: 7053 Writer.write_string(writer, 'kernel', obj.kernel) 7054 if obj.reported_kernel_cmdline is not None: 7055 Writer.write_string(writer, 'reported_kernel_cmdline', obj.reported_kernel_cmdline) 7056 if obj.type is not None: 7057 Writer.write_string(writer, 'type', obj.type) 7058 if obj.version is not None: 7059 VersionWriter.write_one(obj.version, writer, 'version') 7060 writer.write_end()
7062 @staticmethod 7063 def write_many(objs, writer, singular=None, plural=None): 7064 if singular is None: 7065 singular = 'os' 7066 if plural is None: 7067 plural = 'oss' 7068 writer.write_start(plural) 7069 if isinstance(objs, List): 7070 href = objs.href 7071 if href is not None: 7072 writer.write_attribute('href', href) 7073 for obj in objs: 7074 OperatingSystemWriter.write_one(obj, writer, singular) 7075 writer.write_end()
7078class OperatingSystemInfoWriter(Writer): 7079 7080 def __init__(self): 7081 super(OperatingSystemInfoWriter, self).__init__() 7082 7083 @staticmethod 7084 def write_one(obj, writer, singular=None): 7085 if singular is None: 7086 singular = 'operating_system' 7087 writer.write_start(singular) 7088 href = obj.href 7089 if href is not None: 7090 writer.write_attribute('href', href) 7091 if obj.id is not None: 7092 writer.write_attribute('id', obj.id) 7093 if obj.architecture is not None: 7094 Writer.write_string(writer, 'architecture', obj.architecture.value) 7095 if obj.comment is not None: 7096 Writer.write_string(writer, 'comment', obj.comment) 7097 if obj.description is not None: 7098 Writer.write_string(writer, 'description', obj.description) 7099 if obj.large_icon is not None: 7100 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 7101 if obj.name is not None: 7102 Writer.write_string(writer, 'name', obj.name) 7103 if obj.small_icon is not None: 7104 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 7105 if obj.tpm_support is not None: 7106 Writer.write_string(writer, 'tpm_support', obj.tpm_support.value) 7107 writer.write_end() 7108 7109 @staticmethod 7110 def write_many(objs, writer, singular=None, plural=None): 7111 if singular is None: 7112 singular = 'operating_system' 7113 if plural is None: 7114 plural = 'operation_systems' 7115 writer.write_start(plural) 7116 if isinstance(objs, List): 7117 href = objs.href 7118 if href is not None: 7119 writer.write_attribute('href', href) 7120 for obj in objs: 7121 OperatingSystemInfoWriter.write_one(obj, writer, singular) 7122 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7083 @staticmethod 7084 def write_one(obj, writer, singular=None): 7085 if singular is None: 7086 singular = 'operating_system' 7087 writer.write_start(singular) 7088 href = obj.href 7089 if href is not None: 7090 writer.write_attribute('href', href) 7091 if obj.id is not None: 7092 writer.write_attribute('id', obj.id) 7093 if obj.architecture is not None: 7094 Writer.write_string(writer, 'architecture', obj.architecture.value) 7095 if obj.comment is not None: 7096 Writer.write_string(writer, 'comment', obj.comment) 7097 if obj.description is not None: 7098 Writer.write_string(writer, 'description', obj.description) 7099 if obj.large_icon is not None: 7100 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 7101 if obj.name is not None: 7102 Writer.write_string(writer, 'name', obj.name) 7103 if obj.small_icon is not None: 7104 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 7105 if obj.tpm_support is not None: 7106 Writer.write_string(writer, 'tpm_support', obj.tpm_support.value) 7107 writer.write_end()
7109 @staticmethod 7110 def write_many(objs, writer, singular=None, plural=None): 7111 if singular is None: 7112 singular = 'operating_system' 7113 if plural is None: 7114 plural = 'operation_systems' 7115 writer.write_start(plural) 7116 if isinstance(objs, List): 7117 href = objs.href 7118 if href is not None: 7119 writer.write_attribute('href', href) 7120 for obj in objs: 7121 OperatingSystemInfoWriter.write_one(obj, writer, singular) 7122 writer.write_end()
7125class OptionWriter(Writer): 7126 7127 def __init__(self): 7128 super(OptionWriter, self).__init__() 7129 7130 @staticmethod 7131 def write_one(obj, writer, singular=None): 7132 if singular is None: 7133 singular = 'option' 7134 writer.write_start(singular) 7135 href = obj.href 7136 if href is not None: 7137 writer.write_attribute('href', href) 7138 if obj.name is not None: 7139 Writer.write_string(writer, 'name', obj.name) 7140 if obj.type is not None: 7141 Writer.write_string(writer, 'type', obj.type) 7142 if obj.value is not None: 7143 Writer.write_string(writer, 'value', obj.value) 7144 writer.write_end() 7145 7146 @staticmethod 7147 def write_many(objs, writer, singular=None, plural=None): 7148 if singular is None: 7149 singular = 'option' 7150 if plural is None: 7151 plural = 'options' 7152 writer.write_start(plural) 7153 if isinstance(objs, List): 7154 href = objs.href 7155 if href is not None: 7156 writer.write_attribute('href', href) 7157 for obj in objs: 7158 OptionWriter.write_one(obj, writer, singular) 7159 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7130 @staticmethod 7131 def write_one(obj, writer, singular=None): 7132 if singular is None: 7133 singular = 'option' 7134 writer.write_start(singular) 7135 href = obj.href 7136 if href is not None: 7137 writer.write_attribute('href', href) 7138 if obj.name is not None: 7139 Writer.write_string(writer, 'name', obj.name) 7140 if obj.type is not None: 7141 Writer.write_string(writer, 'type', obj.type) 7142 if obj.value is not None: 7143 Writer.write_string(writer, 'value', obj.value) 7144 writer.write_end()
7146 @staticmethod 7147 def write_many(objs, writer, singular=None, plural=None): 7148 if singular is None: 7149 singular = 'option' 7150 if plural is None: 7151 plural = 'options' 7152 writer.write_start(plural) 7153 if isinstance(objs, List): 7154 href = objs.href 7155 if href is not None: 7156 writer.write_attribute('href', href) 7157 for obj in objs: 7158 OptionWriter.write_one(obj, writer, singular) 7159 writer.write_end()
7162class PackageWriter(Writer): 7163 7164 def __init__(self): 7165 super(PackageWriter, self).__init__() 7166 7167 @staticmethod 7168 def write_one(obj, writer, singular=None): 7169 if singular is None: 7170 singular = 'package' 7171 writer.write_start(singular) 7172 href = obj.href 7173 if href is not None: 7174 writer.write_attribute('href', href) 7175 if obj.name is not None: 7176 Writer.write_string(writer, 'name', obj.name) 7177 writer.write_end() 7178 7179 @staticmethod 7180 def write_many(objs, writer, singular=None, plural=None): 7181 if singular is None: 7182 singular = 'package' 7183 if plural is None: 7184 plural = 'packages' 7185 writer.write_start(plural) 7186 if isinstance(objs, List): 7187 href = objs.href 7188 if href is not None: 7189 writer.write_attribute('href', href) 7190 for obj in objs: 7191 PackageWriter.write_one(obj, writer, singular) 7192 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7167 @staticmethod 7168 def write_one(obj, writer, singular=None): 7169 if singular is None: 7170 singular = 'package' 7171 writer.write_start(singular) 7172 href = obj.href 7173 if href is not None: 7174 writer.write_attribute('href', href) 7175 if obj.name is not None: 7176 Writer.write_string(writer, 'name', obj.name) 7177 writer.write_end()
7179 @staticmethod 7180 def write_many(objs, writer, singular=None, plural=None): 7181 if singular is None: 7182 singular = 'package' 7183 if plural is None: 7184 plural = 'packages' 7185 writer.write_start(plural) 7186 if isinstance(objs, List): 7187 href = objs.href 7188 if href is not None: 7189 writer.write_attribute('href', href) 7190 for obj in objs: 7191 PackageWriter.write_one(obj, writer, singular) 7192 writer.write_end()
7195class PayloadWriter(Writer): 7196 7197 def __init__(self): 7198 super(PayloadWriter, self).__init__() 7199 7200 @staticmethod 7201 def write_one(obj, writer, singular=None): 7202 if singular is None: 7203 singular = 'payload' 7204 writer.write_start(singular) 7205 href = obj.href 7206 if href is not None: 7207 writer.write_attribute('href', href) 7208 if obj.files is not None: 7209 FileWriter.write_many(obj.files, writer, 'file', 'files') 7210 if obj.type is not None: 7211 Writer.write_string(writer, 'type', obj.type.value) 7212 if obj.volume_id is not None: 7213 Writer.write_string(writer, 'volume_id', obj.volume_id) 7214 writer.write_end() 7215 7216 @staticmethod 7217 def write_many(objs, writer, singular=None, plural=None): 7218 if singular is None: 7219 singular = 'payload' 7220 if plural is None: 7221 plural = 'payloads' 7222 writer.write_start(plural) 7223 if isinstance(objs, List): 7224 href = objs.href 7225 if href is not None: 7226 writer.write_attribute('href', href) 7227 for obj in objs: 7228 PayloadWriter.write_one(obj, writer, singular) 7229 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7200 @staticmethod 7201 def write_one(obj, writer, singular=None): 7202 if singular is None: 7203 singular = 'payload' 7204 writer.write_start(singular) 7205 href = obj.href 7206 if href is not None: 7207 writer.write_attribute('href', href) 7208 if obj.files is not None: 7209 FileWriter.write_many(obj.files, writer, 'file', 'files') 7210 if obj.type is not None: 7211 Writer.write_string(writer, 'type', obj.type.value) 7212 if obj.volume_id is not None: 7213 Writer.write_string(writer, 'volume_id', obj.volume_id) 7214 writer.write_end()
7216 @staticmethod 7217 def write_many(objs, writer, singular=None, plural=None): 7218 if singular is None: 7219 singular = 'payload' 7220 if plural is None: 7221 plural = 'payloads' 7222 writer.write_start(plural) 7223 if isinstance(objs, List): 7224 href = objs.href 7225 if href is not None: 7226 writer.write_attribute('href', href) 7227 for obj in objs: 7228 PayloadWriter.write_one(obj, writer, singular) 7229 writer.write_end()
7232class PermissionWriter(Writer): 7233 7234 def __init__(self): 7235 super(PermissionWriter, self).__init__() 7236 7237 @staticmethod 7238 def write_one(obj, writer, singular=None): 7239 if singular is None: 7240 singular = 'permission' 7241 writer.write_start(singular) 7242 href = obj.href 7243 if href is not None: 7244 writer.write_attribute('href', href) 7245 if obj.id is not None: 7246 writer.write_attribute('id', obj.id) 7247 if obj.comment is not None: 7248 Writer.write_string(writer, 'comment', obj.comment) 7249 if obj.description is not None: 7250 Writer.write_string(writer, 'description', obj.description) 7251 if obj.name is not None: 7252 Writer.write_string(writer, 'name', obj.name) 7253 if obj.cluster is not None: 7254 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 7255 if obj.data_center is not None: 7256 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7257 if obj.disk is not None: 7258 DiskWriter.write_one(obj.disk, writer, 'disk') 7259 if obj.group is not None: 7260 GroupWriter.write_one(obj.group, writer, 'group') 7261 if obj.host is not None: 7262 HostWriter.write_one(obj.host, writer, 'host') 7263 if obj.role is not None: 7264 RoleWriter.write_one(obj.role, writer, 'role') 7265 if obj.storage_domain is not None: 7266 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 7267 if obj.template is not None: 7268 TemplateWriter.write_one(obj.template, writer, 'template') 7269 if obj.user is not None: 7270 UserWriter.write_one(obj.user, writer, 'user') 7271 if obj.vm is not None: 7272 VmWriter.write_one(obj.vm, writer, 'vm') 7273 if obj.vm_pool is not None: 7274 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 7275 writer.write_end() 7276 7277 @staticmethod 7278 def write_many(objs, writer, singular=None, plural=None): 7279 if singular is None: 7280 singular = 'permission' 7281 if plural is None: 7282 plural = 'permissions' 7283 writer.write_start(plural) 7284 if isinstance(objs, List): 7285 href = objs.href 7286 if href is not None: 7287 writer.write_attribute('href', href) 7288 for obj in objs: 7289 PermissionWriter.write_one(obj, writer, singular) 7290 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7237 @staticmethod 7238 def write_one(obj, writer, singular=None): 7239 if singular is None: 7240 singular = 'permission' 7241 writer.write_start(singular) 7242 href = obj.href 7243 if href is not None: 7244 writer.write_attribute('href', href) 7245 if obj.id is not None: 7246 writer.write_attribute('id', obj.id) 7247 if obj.comment is not None: 7248 Writer.write_string(writer, 'comment', obj.comment) 7249 if obj.description is not None: 7250 Writer.write_string(writer, 'description', obj.description) 7251 if obj.name is not None: 7252 Writer.write_string(writer, 'name', obj.name) 7253 if obj.cluster is not None: 7254 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 7255 if obj.data_center is not None: 7256 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7257 if obj.disk is not None: 7258 DiskWriter.write_one(obj.disk, writer, 'disk') 7259 if obj.group is not None: 7260 GroupWriter.write_one(obj.group, writer, 'group') 7261 if obj.host is not None: 7262 HostWriter.write_one(obj.host, writer, 'host') 7263 if obj.role is not None: 7264 RoleWriter.write_one(obj.role, writer, 'role') 7265 if obj.storage_domain is not None: 7266 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 7267 if obj.template is not None: 7268 TemplateWriter.write_one(obj.template, writer, 'template') 7269 if obj.user is not None: 7270 UserWriter.write_one(obj.user, writer, 'user') 7271 if obj.vm is not None: 7272 VmWriter.write_one(obj.vm, writer, 'vm') 7273 if obj.vm_pool is not None: 7274 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 7275 writer.write_end()
7277 @staticmethod 7278 def write_many(objs, writer, singular=None, plural=None): 7279 if singular is None: 7280 singular = 'permission' 7281 if plural is None: 7282 plural = 'permissions' 7283 writer.write_start(plural) 7284 if isinstance(objs, List): 7285 href = objs.href 7286 if href is not None: 7287 writer.write_attribute('href', href) 7288 for obj in objs: 7289 PermissionWriter.write_one(obj, writer, singular) 7290 writer.write_end()
7293class PermitWriter(Writer): 7294 7295 def __init__(self): 7296 super(PermitWriter, self).__init__() 7297 7298 @staticmethod 7299 def write_one(obj, writer, singular=None): 7300 if singular is None: 7301 singular = 'permit' 7302 writer.write_start(singular) 7303 href = obj.href 7304 if href is not None: 7305 writer.write_attribute('href', href) 7306 if obj.id is not None: 7307 writer.write_attribute('id', obj.id) 7308 if obj.administrative is not None: 7309 Writer.write_boolean(writer, 'administrative', obj.administrative) 7310 if obj.comment is not None: 7311 Writer.write_string(writer, 'comment', obj.comment) 7312 if obj.description is not None: 7313 Writer.write_string(writer, 'description', obj.description) 7314 if obj.name is not None: 7315 Writer.write_string(writer, 'name', obj.name) 7316 if obj.role is not None: 7317 RoleWriter.write_one(obj.role, writer, 'role') 7318 writer.write_end() 7319 7320 @staticmethod 7321 def write_many(objs, writer, singular=None, plural=None): 7322 if singular is None: 7323 singular = 'permit' 7324 if plural is None: 7325 plural = 'permits' 7326 writer.write_start(plural) 7327 if isinstance(objs, List): 7328 href = objs.href 7329 if href is not None: 7330 writer.write_attribute('href', href) 7331 for obj in objs: 7332 PermitWriter.write_one(obj, writer, singular) 7333 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7298 @staticmethod 7299 def write_one(obj, writer, singular=None): 7300 if singular is None: 7301 singular = 'permit' 7302 writer.write_start(singular) 7303 href = obj.href 7304 if href is not None: 7305 writer.write_attribute('href', href) 7306 if obj.id is not None: 7307 writer.write_attribute('id', obj.id) 7308 if obj.administrative is not None: 7309 Writer.write_boolean(writer, 'administrative', obj.administrative) 7310 if obj.comment is not None: 7311 Writer.write_string(writer, 'comment', obj.comment) 7312 if obj.description is not None: 7313 Writer.write_string(writer, 'description', obj.description) 7314 if obj.name is not None: 7315 Writer.write_string(writer, 'name', obj.name) 7316 if obj.role is not None: 7317 RoleWriter.write_one(obj.role, writer, 'role') 7318 writer.write_end()
7320 @staticmethod 7321 def write_many(objs, writer, singular=None, plural=None): 7322 if singular is None: 7323 singular = 'permit' 7324 if plural is None: 7325 plural = 'permits' 7326 writer.write_start(plural) 7327 if isinstance(objs, List): 7328 href = objs.href 7329 if href is not None: 7330 writer.write_attribute('href', href) 7331 for obj in objs: 7332 PermitWriter.write_one(obj, writer, singular) 7333 writer.write_end()
7336class PmProxyWriter(Writer): 7337 7338 def __init__(self): 7339 super(PmProxyWriter, self).__init__() 7340 7341 @staticmethod 7342 def write_one(obj, writer, singular=None): 7343 if singular is None: 7344 singular = 'pm_proxy' 7345 writer.write_start(singular) 7346 href = obj.href 7347 if href is not None: 7348 writer.write_attribute('href', href) 7349 if obj.type is not None: 7350 Writer.write_string(writer, 'type', obj.type.value) 7351 writer.write_end() 7352 7353 @staticmethod 7354 def write_many(objs, writer, singular=None, plural=None): 7355 if singular is None: 7356 singular = 'pm_proxy' 7357 if plural is None: 7358 plural = 'pm_proxies' 7359 writer.write_start(plural) 7360 if isinstance(objs, List): 7361 href = objs.href 7362 if href is not None: 7363 writer.write_attribute('href', href) 7364 for obj in objs: 7365 PmProxyWriter.write_one(obj, writer, singular) 7366 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7341 @staticmethod 7342 def write_one(obj, writer, singular=None): 7343 if singular is None: 7344 singular = 'pm_proxy' 7345 writer.write_start(singular) 7346 href = obj.href 7347 if href is not None: 7348 writer.write_attribute('href', href) 7349 if obj.type is not None: 7350 Writer.write_string(writer, 'type', obj.type.value) 7351 writer.write_end()
7353 @staticmethod 7354 def write_many(objs, writer, singular=None, plural=None): 7355 if singular is None: 7356 singular = 'pm_proxy' 7357 if plural is None: 7358 plural = 'pm_proxies' 7359 writer.write_start(plural) 7360 if isinstance(objs, List): 7361 href = objs.href 7362 if href is not None: 7363 writer.write_attribute('href', href) 7364 for obj in objs: 7365 PmProxyWriter.write_one(obj, writer, singular) 7366 writer.write_end()
7369class PortMirroringWriter(Writer): 7370 7371 def __init__(self): 7372 super(PortMirroringWriter, self).__init__() 7373 7374 @staticmethod 7375 def write_one(obj, writer, singular=None): 7376 if singular is None: 7377 singular = 'port_mirroring' 7378 writer.write_start(singular) 7379 href = obj.href 7380 if href is not None: 7381 writer.write_attribute('href', href) 7382 writer.write_end() 7383 7384 @staticmethod 7385 def write_many(objs, writer, singular=None, plural=None): 7386 if singular is None: 7387 singular = 'port_mirroring' 7388 if plural is None: 7389 plural = 'port_mirrorings' 7390 writer.write_start(plural) 7391 if isinstance(objs, List): 7392 href = objs.href 7393 if href is not None: 7394 writer.write_attribute('href', href) 7395 for obj in objs: 7396 PortMirroringWriter.write_one(obj, writer, singular) 7397 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7384 @staticmethod 7385 def write_many(objs, writer, singular=None, plural=None): 7386 if singular is None: 7387 singular = 'port_mirroring' 7388 if plural is None: 7389 plural = 'port_mirrorings' 7390 writer.write_start(plural) 7391 if isinstance(objs, List): 7392 href = objs.href 7393 if href is not None: 7394 writer.write_attribute('href', href) 7395 for obj in objs: 7396 PortMirroringWriter.write_one(obj, writer, singular) 7397 writer.write_end()
7400class PowerManagementWriter(Writer): 7401 7402 def __init__(self): 7403 super(PowerManagementWriter, self).__init__() 7404 7405 @staticmethod 7406 def write_one(obj, writer, singular=None): 7407 if singular is None: 7408 singular = 'power_management' 7409 writer.write_start(singular) 7410 href = obj.href 7411 if href is not None: 7412 writer.write_attribute('href', href) 7413 if obj.address is not None: 7414 Writer.write_string(writer, 'address', obj.address) 7415 if obj.agents is not None: 7416 AgentWriter.write_many(obj.agents, writer, 'agent', 'agents') 7417 if obj.automatic_pm_enabled is not None: 7418 Writer.write_boolean(writer, 'automatic_pm_enabled', obj.automatic_pm_enabled) 7419 if obj.enabled is not None: 7420 Writer.write_boolean(writer, 'enabled', obj.enabled) 7421 if obj.kdump_detection is not None: 7422 Writer.write_boolean(writer, 'kdump_detection', obj.kdump_detection) 7423 if obj.options is not None: 7424 OptionWriter.write_many(obj.options, writer, 'option', 'options') 7425 if obj.password is not None: 7426 Writer.write_string(writer, 'password', obj.password) 7427 if obj.pm_proxies is not None: 7428 PmProxyWriter.write_many(obj.pm_proxies, writer, 'pm_proxy', 'pm_proxies') 7429 if obj.status is not None: 7430 Writer.write_string(writer, 'status', obj.status.value) 7431 if obj.type is not None: 7432 Writer.write_string(writer, 'type', obj.type) 7433 if obj.username is not None: 7434 Writer.write_string(writer, 'username', obj.username) 7435 writer.write_end() 7436 7437 @staticmethod 7438 def write_many(objs, writer, singular=None, plural=None): 7439 if singular is None: 7440 singular = 'power_management' 7441 if plural is None: 7442 plural = 'power_managements' 7443 writer.write_start(plural) 7444 if isinstance(objs, List): 7445 href = objs.href 7446 if href is not None: 7447 writer.write_attribute('href', href) 7448 for obj in objs: 7449 PowerManagementWriter.write_one(obj, writer, singular) 7450 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7405 @staticmethod 7406 def write_one(obj, writer, singular=None): 7407 if singular is None: 7408 singular = 'power_management' 7409 writer.write_start(singular) 7410 href = obj.href 7411 if href is not None: 7412 writer.write_attribute('href', href) 7413 if obj.address is not None: 7414 Writer.write_string(writer, 'address', obj.address) 7415 if obj.agents is not None: 7416 AgentWriter.write_many(obj.agents, writer, 'agent', 'agents') 7417 if obj.automatic_pm_enabled is not None: 7418 Writer.write_boolean(writer, 'automatic_pm_enabled', obj.automatic_pm_enabled) 7419 if obj.enabled is not None: 7420 Writer.write_boolean(writer, 'enabled', obj.enabled) 7421 if obj.kdump_detection is not None: 7422 Writer.write_boolean(writer, 'kdump_detection', obj.kdump_detection) 7423 if obj.options is not None: 7424 OptionWriter.write_many(obj.options, writer, 'option', 'options') 7425 if obj.password is not None: 7426 Writer.write_string(writer, 'password', obj.password) 7427 if obj.pm_proxies is not None: 7428 PmProxyWriter.write_many(obj.pm_proxies, writer, 'pm_proxy', 'pm_proxies') 7429 if obj.status is not None: 7430 Writer.write_string(writer, 'status', obj.status.value) 7431 if obj.type is not None: 7432 Writer.write_string(writer, 'type', obj.type) 7433 if obj.username is not None: 7434 Writer.write_string(writer, 'username', obj.username) 7435 writer.write_end()
7437 @staticmethod 7438 def write_many(objs, writer, singular=None, plural=None): 7439 if singular is None: 7440 singular = 'power_management' 7441 if plural is None: 7442 plural = 'power_managements' 7443 writer.write_start(plural) 7444 if isinstance(objs, List): 7445 href = objs.href 7446 if href is not None: 7447 writer.write_attribute('href', href) 7448 for obj in objs: 7449 PowerManagementWriter.write_one(obj, writer, singular) 7450 writer.write_end()
7453class ProductWriter(Writer): 7454 7455 def __init__(self): 7456 super(ProductWriter, self).__init__() 7457 7458 @staticmethod 7459 def write_one(obj, writer, singular=None): 7460 if singular is None: 7461 singular = 'product' 7462 writer.write_start(singular) 7463 href = obj.href 7464 if href is not None: 7465 writer.write_attribute('href', href) 7466 if obj.id is not None: 7467 writer.write_attribute('id', obj.id) 7468 if obj.comment is not None: 7469 Writer.write_string(writer, 'comment', obj.comment) 7470 if obj.description is not None: 7471 Writer.write_string(writer, 'description', obj.description) 7472 if obj.name is not None: 7473 Writer.write_string(writer, 'name', obj.name) 7474 writer.write_end() 7475 7476 @staticmethod 7477 def write_many(objs, writer, singular=None, plural=None): 7478 if singular is None: 7479 singular = 'product' 7480 if plural is None: 7481 plural = 'products' 7482 writer.write_start(plural) 7483 if isinstance(objs, List): 7484 href = objs.href 7485 if href is not None: 7486 writer.write_attribute('href', href) 7487 for obj in objs: 7488 ProductWriter.write_one(obj, writer, singular) 7489 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7458 @staticmethod 7459 def write_one(obj, writer, singular=None): 7460 if singular is None: 7461 singular = 'product' 7462 writer.write_start(singular) 7463 href = obj.href 7464 if href is not None: 7465 writer.write_attribute('href', href) 7466 if obj.id is not None: 7467 writer.write_attribute('id', obj.id) 7468 if obj.comment is not None: 7469 Writer.write_string(writer, 'comment', obj.comment) 7470 if obj.description is not None: 7471 Writer.write_string(writer, 'description', obj.description) 7472 if obj.name is not None: 7473 Writer.write_string(writer, 'name', obj.name) 7474 writer.write_end()
7476 @staticmethod 7477 def write_many(objs, writer, singular=None, plural=None): 7478 if singular is None: 7479 singular = 'product' 7480 if plural is None: 7481 plural = 'products' 7482 writer.write_start(plural) 7483 if isinstance(objs, List): 7484 href = objs.href 7485 if href is not None: 7486 writer.write_attribute('href', href) 7487 for obj in objs: 7488 ProductWriter.write_one(obj, writer, singular) 7489 writer.write_end()
7492class ProductInfoWriter(Writer): 7493 7494 def __init__(self): 7495 super(ProductInfoWriter, self).__init__() 7496 7497 @staticmethod 7498 def write_one(obj, writer, singular=None): 7499 if singular is None: 7500 singular = 'product_info' 7501 writer.write_start(singular) 7502 href = obj.href 7503 if href is not None: 7504 writer.write_attribute('href', href) 7505 if obj.instance_id is not None: 7506 Writer.write_string(writer, 'instance_id', obj.instance_id) 7507 if obj.name is not None: 7508 Writer.write_string(writer, 'name', obj.name) 7509 if obj.vendor is not None: 7510 Writer.write_string(writer, 'vendor', obj.vendor) 7511 if obj.version is not None: 7512 VersionWriter.write_one(obj.version, writer, 'version') 7513 writer.write_end() 7514 7515 @staticmethod 7516 def write_many(objs, writer, singular=None, plural=None): 7517 if singular is None: 7518 singular = 'product_info' 7519 if plural is None: 7520 plural = 'product_infos' 7521 writer.write_start(plural) 7522 if isinstance(objs, List): 7523 href = objs.href 7524 if href is not None: 7525 writer.write_attribute('href', href) 7526 for obj in objs: 7527 ProductInfoWriter.write_one(obj, writer, singular) 7528 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7497 @staticmethod 7498 def write_one(obj, writer, singular=None): 7499 if singular is None: 7500 singular = 'product_info' 7501 writer.write_start(singular) 7502 href = obj.href 7503 if href is not None: 7504 writer.write_attribute('href', href) 7505 if obj.instance_id is not None: 7506 Writer.write_string(writer, 'instance_id', obj.instance_id) 7507 if obj.name is not None: 7508 Writer.write_string(writer, 'name', obj.name) 7509 if obj.vendor is not None: 7510 Writer.write_string(writer, 'vendor', obj.vendor) 7511 if obj.version is not None: 7512 VersionWriter.write_one(obj.version, writer, 'version') 7513 writer.write_end()
7515 @staticmethod 7516 def write_many(objs, writer, singular=None, plural=None): 7517 if singular is None: 7518 singular = 'product_info' 7519 if plural is None: 7520 plural = 'product_infos' 7521 writer.write_start(plural) 7522 if isinstance(objs, List): 7523 href = objs.href 7524 if href is not None: 7525 writer.write_attribute('href', href) 7526 for obj in objs: 7527 ProductInfoWriter.write_one(obj, writer, singular) 7528 writer.write_end()
7531class ProfileDetailWriter(Writer): 7532 7533 def __init__(self): 7534 super(ProfileDetailWriter, self).__init__() 7535 7536 @staticmethod 7537 def write_one(obj, writer, singular=None): 7538 if singular is None: 7539 singular = 'profile_detail' 7540 writer.write_start(singular) 7541 href = obj.href 7542 if href is not None: 7543 writer.write_attribute('href', href) 7544 if obj.block_statistics is not None: 7545 BlockStatisticWriter.write_many(obj.block_statistics, writer, 'block_statistic', 'block_statistics') 7546 if obj.duration is not None: 7547 Writer.write_integer(writer, 'duration', obj.duration) 7548 if obj.fop_statistics is not None: 7549 FopStatisticWriter.write_many(obj.fop_statistics, writer, 'fop_statistic', 'fop_statistics') 7550 if obj.profile_type is not None: 7551 Writer.write_string(writer, 'profile_type', obj.profile_type) 7552 if obj.statistics is not None: 7553 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 7554 writer.write_end() 7555 7556 @staticmethod 7557 def write_many(objs, writer, singular=None, plural=None): 7558 if singular is None: 7559 singular = 'profile_detail' 7560 if plural is None: 7561 plural = 'profile_details' 7562 writer.write_start(plural) 7563 if isinstance(objs, List): 7564 href = objs.href 7565 if href is not None: 7566 writer.write_attribute('href', href) 7567 for obj in objs: 7568 ProfileDetailWriter.write_one(obj, writer, singular) 7569 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7536 @staticmethod 7537 def write_one(obj, writer, singular=None): 7538 if singular is None: 7539 singular = 'profile_detail' 7540 writer.write_start(singular) 7541 href = obj.href 7542 if href is not None: 7543 writer.write_attribute('href', href) 7544 if obj.block_statistics is not None: 7545 BlockStatisticWriter.write_many(obj.block_statistics, writer, 'block_statistic', 'block_statistics') 7546 if obj.duration is not None: 7547 Writer.write_integer(writer, 'duration', obj.duration) 7548 if obj.fop_statistics is not None: 7549 FopStatisticWriter.write_many(obj.fop_statistics, writer, 'fop_statistic', 'fop_statistics') 7550 if obj.profile_type is not None: 7551 Writer.write_string(writer, 'profile_type', obj.profile_type) 7552 if obj.statistics is not None: 7553 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 7554 writer.write_end()
7556 @staticmethod 7557 def write_many(objs, writer, singular=None, plural=None): 7558 if singular is None: 7559 singular = 'profile_detail' 7560 if plural is None: 7561 plural = 'profile_details' 7562 writer.write_start(plural) 7563 if isinstance(objs, List): 7564 href = objs.href 7565 if href is not None: 7566 writer.write_attribute('href', href) 7567 for obj in objs: 7568 ProfileDetailWriter.write_one(obj, writer, singular) 7569 writer.write_end()
7572class PropertyWriter(Writer): 7573 7574 def __init__(self): 7575 super(PropertyWriter, self).__init__() 7576 7577 @staticmethod 7578 def write_one(obj, writer, singular=None): 7579 if singular is None: 7580 singular = 'property' 7581 writer.write_start(singular) 7582 href = obj.href 7583 if href is not None: 7584 writer.write_attribute('href', href) 7585 if obj.name is not None: 7586 Writer.write_string(writer, 'name', obj.name) 7587 if obj.value is not None: 7588 Writer.write_string(writer, 'value', obj.value) 7589 writer.write_end() 7590 7591 @staticmethod 7592 def write_many(objs, writer, singular=None, plural=None): 7593 if singular is None: 7594 singular = 'property' 7595 if plural is None: 7596 plural = 'properties' 7597 writer.write_start(plural) 7598 if isinstance(objs, List): 7599 href = objs.href 7600 if href is not None: 7601 writer.write_attribute('href', href) 7602 for obj in objs: 7603 PropertyWriter.write_one(obj, writer, singular) 7604 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7577 @staticmethod 7578 def write_one(obj, writer, singular=None): 7579 if singular is None: 7580 singular = 'property' 7581 writer.write_start(singular) 7582 href = obj.href 7583 if href is not None: 7584 writer.write_attribute('href', href) 7585 if obj.name is not None: 7586 Writer.write_string(writer, 'name', obj.name) 7587 if obj.value is not None: 7588 Writer.write_string(writer, 'value', obj.value) 7589 writer.write_end()
7591 @staticmethod 7592 def write_many(objs, writer, singular=None, plural=None): 7593 if singular is None: 7594 singular = 'property' 7595 if plural is None: 7596 plural = 'properties' 7597 writer.write_start(plural) 7598 if isinstance(objs, List): 7599 href = objs.href 7600 if href is not None: 7601 writer.write_attribute('href', href) 7602 for obj in objs: 7603 PropertyWriter.write_one(obj, writer, singular) 7604 writer.write_end()
7607class ProxyTicketWriter(Writer): 7608 7609 def __init__(self): 7610 super(ProxyTicketWriter, self).__init__() 7611 7612 @staticmethod 7613 def write_one(obj, writer, singular=None): 7614 if singular is None: 7615 singular = 'proxy_ticket' 7616 writer.write_start(singular) 7617 href = obj.href 7618 if href is not None: 7619 writer.write_attribute('href', href) 7620 if obj.value is not None: 7621 Writer.write_string(writer, 'value', obj.value) 7622 writer.write_end() 7623 7624 @staticmethod 7625 def write_many(objs, writer, singular=None, plural=None): 7626 if singular is None: 7627 singular = 'proxy_ticket' 7628 if plural is None: 7629 plural = 'proxy_tickets' 7630 writer.write_start(plural) 7631 if isinstance(objs, List): 7632 href = objs.href 7633 if href is not None: 7634 writer.write_attribute('href', href) 7635 for obj in objs: 7636 ProxyTicketWriter.write_one(obj, writer, singular) 7637 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7612 @staticmethod 7613 def write_one(obj, writer, singular=None): 7614 if singular is None: 7615 singular = 'proxy_ticket' 7616 writer.write_start(singular) 7617 href = obj.href 7618 if href is not None: 7619 writer.write_attribute('href', href) 7620 if obj.value is not None: 7621 Writer.write_string(writer, 'value', obj.value) 7622 writer.write_end()
7624 @staticmethod 7625 def write_many(objs, writer, singular=None, plural=None): 7626 if singular is None: 7627 singular = 'proxy_ticket' 7628 if plural is None: 7629 plural = 'proxy_tickets' 7630 writer.write_start(plural) 7631 if isinstance(objs, List): 7632 href = objs.href 7633 if href is not None: 7634 writer.write_attribute('href', href) 7635 for obj in objs: 7636 ProxyTicketWriter.write_one(obj, writer, singular) 7637 writer.write_end()
7640class QosWriter(Writer): 7641 7642 def __init__(self): 7643 super(QosWriter, self).__init__() 7644 7645 @staticmethod 7646 def write_one(obj, writer, singular=None): 7647 if singular is None: 7648 singular = 'qos' 7649 writer.write_start(singular) 7650 href = obj.href 7651 if href is not None: 7652 writer.write_attribute('href', href) 7653 if obj.id is not None: 7654 writer.write_attribute('id', obj.id) 7655 if obj.comment is not None: 7656 Writer.write_string(writer, 'comment', obj.comment) 7657 if obj.cpu_limit is not None: 7658 Writer.write_integer(writer, 'cpu_limit', obj.cpu_limit) 7659 if obj.description is not None: 7660 Writer.write_string(writer, 'description', obj.description) 7661 if obj.inbound_average is not None: 7662 Writer.write_integer(writer, 'inbound_average', obj.inbound_average) 7663 if obj.inbound_burst is not None: 7664 Writer.write_integer(writer, 'inbound_burst', obj.inbound_burst) 7665 if obj.inbound_peak is not None: 7666 Writer.write_integer(writer, 'inbound_peak', obj.inbound_peak) 7667 if obj.max_iops is not None: 7668 Writer.write_integer(writer, 'max_iops', obj.max_iops) 7669 if obj.max_read_iops is not None: 7670 Writer.write_integer(writer, 'max_read_iops', obj.max_read_iops) 7671 if obj.max_read_throughput is not None: 7672 Writer.write_integer(writer, 'max_read_throughput', obj.max_read_throughput) 7673 if obj.max_throughput is not None: 7674 Writer.write_integer(writer, 'max_throughput', obj.max_throughput) 7675 if obj.max_write_iops is not None: 7676 Writer.write_integer(writer, 'max_write_iops', obj.max_write_iops) 7677 if obj.max_write_throughput is not None: 7678 Writer.write_integer(writer, 'max_write_throughput', obj.max_write_throughput) 7679 if obj.name is not None: 7680 Writer.write_string(writer, 'name', obj.name) 7681 if obj.outbound_average is not None: 7682 Writer.write_integer(writer, 'outbound_average', obj.outbound_average) 7683 if obj.outbound_average_linkshare is not None: 7684 Writer.write_integer(writer, 'outbound_average_linkshare', obj.outbound_average_linkshare) 7685 if obj.outbound_average_realtime is not None: 7686 Writer.write_integer(writer, 'outbound_average_realtime', obj.outbound_average_realtime) 7687 if obj.outbound_average_upperlimit is not None: 7688 Writer.write_integer(writer, 'outbound_average_upperlimit', obj.outbound_average_upperlimit) 7689 if obj.outbound_burst is not None: 7690 Writer.write_integer(writer, 'outbound_burst', obj.outbound_burst) 7691 if obj.outbound_peak is not None: 7692 Writer.write_integer(writer, 'outbound_peak', obj.outbound_peak) 7693 if obj.type is not None: 7694 Writer.write_string(writer, 'type', obj.type.value) 7695 if obj.data_center is not None: 7696 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7697 writer.write_end() 7698 7699 @staticmethod 7700 def write_many(objs, writer, singular=None, plural=None): 7701 if singular is None: 7702 singular = 'qos' 7703 if plural is None: 7704 plural = 'qoss' 7705 writer.write_start(plural) 7706 if isinstance(objs, List): 7707 href = objs.href 7708 if href is not None: 7709 writer.write_attribute('href', href) 7710 for obj in objs: 7711 QosWriter.write_one(obj, writer, singular) 7712 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7645 @staticmethod 7646 def write_one(obj, writer, singular=None): 7647 if singular is None: 7648 singular = 'qos' 7649 writer.write_start(singular) 7650 href = obj.href 7651 if href is not None: 7652 writer.write_attribute('href', href) 7653 if obj.id is not None: 7654 writer.write_attribute('id', obj.id) 7655 if obj.comment is not None: 7656 Writer.write_string(writer, 'comment', obj.comment) 7657 if obj.cpu_limit is not None: 7658 Writer.write_integer(writer, 'cpu_limit', obj.cpu_limit) 7659 if obj.description is not None: 7660 Writer.write_string(writer, 'description', obj.description) 7661 if obj.inbound_average is not None: 7662 Writer.write_integer(writer, 'inbound_average', obj.inbound_average) 7663 if obj.inbound_burst is not None: 7664 Writer.write_integer(writer, 'inbound_burst', obj.inbound_burst) 7665 if obj.inbound_peak is not None: 7666 Writer.write_integer(writer, 'inbound_peak', obj.inbound_peak) 7667 if obj.max_iops is not None: 7668 Writer.write_integer(writer, 'max_iops', obj.max_iops) 7669 if obj.max_read_iops is not None: 7670 Writer.write_integer(writer, 'max_read_iops', obj.max_read_iops) 7671 if obj.max_read_throughput is not None: 7672 Writer.write_integer(writer, 'max_read_throughput', obj.max_read_throughput) 7673 if obj.max_throughput is not None: 7674 Writer.write_integer(writer, 'max_throughput', obj.max_throughput) 7675 if obj.max_write_iops is not None: 7676 Writer.write_integer(writer, 'max_write_iops', obj.max_write_iops) 7677 if obj.max_write_throughput is not None: 7678 Writer.write_integer(writer, 'max_write_throughput', obj.max_write_throughput) 7679 if obj.name is not None: 7680 Writer.write_string(writer, 'name', obj.name) 7681 if obj.outbound_average is not None: 7682 Writer.write_integer(writer, 'outbound_average', obj.outbound_average) 7683 if obj.outbound_average_linkshare is not None: 7684 Writer.write_integer(writer, 'outbound_average_linkshare', obj.outbound_average_linkshare) 7685 if obj.outbound_average_realtime is not None: 7686 Writer.write_integer(writer, 'outbound_average_realtime', obj.outbound_average_realtime) 7687 if obj.outbound_average_upperlimit is not None: 7688 Writer.write_integer(writer, 'outbound_average_upperlimit', obj.outbound_average_upperlimit) 7689 if obj.outbound_burst is not None: 7690 Writer.write_integer(writer, 'outbound_burst', obj.outbound_burst) 7691 if obj.outbound_peak is not None: 7692 Writer.write_integer(writer, 'outbound_peak', obj.outbound_peak) 7693 if obj.type is not None: 7694 Writer.write_string(writer, 'type', obj.type.value) 7695 if obj.data_center is not None: 7696 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7697 writer.write_end()
7699 @staticmethod 7700 def write_many(objs, writer, singular=None, plural=None): 7701 if singular is None: 7702 singular = 'qos' 7703 if plural is None: 7704 plural = 'qoss' 7705 writer.write_start(plural) 7706 if isinstance(objs, List): 7707 href = objs.href 7708 if href is not None: 7709 writer.write_attribute('href', href) 7710 for obj in objs: 7711 QosWriter.write_one(obj, writer, singular) 7712 writer.write_end()
7715class QuotaWriter(Writer): 7716 7717 def __init__(self): 7718 super(QuotaWriter, self).__init__() 7719 7720 @staticmethod 7721 def write_one(obj, writer, singular=None): 7722 if singular is None: 7723 singular = 'quota' 7724 writer.write_start(singular) 7725 href = obj.href 7726 if href is not None: 7727 writer.write_attribute('href', href) 7728 if obj.id is not None: 7729 writer.write_attribute('id', obj.id) 7730 if obj.cluster_hard_limit_pct is not None: 7731 Writer.write_integer(writer, 'cluster_hard_limit_pct', obj.cluster_hard_limit_pct) 7732 if obj.cluster_soft_limit_pct is not None: 7733 Writer.write_integer(writer, 'cluster_soft_limit_pct', obj.cluster_soft_limit_pct) 7734 if obj.comment is not None: 7735 Writer.write_string(writer, 'comment', obj.comment) 7736 if obj.data_center is not None: 7737 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7738 if obj.description is not None: 7739 Writer.write_string(writer, 'description', obj.description) 7740 if obj.disks is not None: 7741 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 7742 if obj.name is not None: 7743 Writer.write_string(writer, 'name', obj.name) 7744 if obj.storage_hard_limit_pct is not None: 7745 Writer.write_integer(writer, 'storage_hard_limit_pct', obj.storage_hard_limit_pct) 7746 if obj.storage_soft_limit_pct is not None: 7747 Writer.write_integer(writer, 'storage_soft_limit_pct', obj.storage_soft_limit_pct) 7748 if obj.users is not None: 7749 UserWriter.write_many(obj.users, writer, 'user', 'users') 7750 if obj.vms is not None: 7751 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 7752 if obj.permissions is not None: 7753 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 7754 if obj.quota_cluster_limits is not None: 7755 QuotaClusterLimitWriter.write_many(obj.quota_cluster_limits, writer, 'quota_cluster_limit', 'quota_cluster_limits') 7756 if obj.quota_storage_limits is not None: 7757 QuotaStorageLimitWriter.write_many(obj.quota_storage_limits, writer, 'quota_storage_limit', 'quota_storage_limits') 7758 writer.write_end() 7759 7760 @staticmethod 7761 def write_many(objs, writer, singular=None, plural=None): 7762 if singular is None: 7763 singular = 'quota' 7764 if plural is None: 7765 plural = 'quotas' 7766 writer.write_start(plural) 7767 if isinstance(objs, List): 7768 href = objs.href 7769 if href is not None: 7770 writer.write_attribute('href', href) 7771 for obj in objs: 7772 QuotaWriter.write_one(obj, writer, singular) 7773 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7720 @staticmethod 7721 def write_one(obj, writer, singular=None): 7722 if singular is None: 7723 singular = 'quota' 7724 writer.write_start(singular) 7725 href = obj.href 7726 if href is not None: 7727 writer.write_attribute('href', href) 7728 if obj.id is not None: 7729 writer.write_attribute('id', obj.id) 7730 if obj.cluster_hard_limit_pct is not None: 7731 Writer.write_integer(writer, 'cluster_hard_limit_pct', obj.cluster_hard_limit_pct) 7732 if obj.cluster_soft_limit_pct is not None: 7733 Writer.write_integer(writer, 'cluster_soft_limit_pct', obj.cluster_soft_limit_pct) 7734 if obj.comment is not None: 7735 Writer.write_string(writer, 'comment', obj.comment) 7736 if obj.data_center is not None: 7737 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 7738 if obj.description is not None: 7739 Writer.write_string(writer, 'description', obj.description) 7740 if obj.disks is not None: 7741 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 7742 if obj.name is not None: 7743 Writer.write_string(writer, 'name', obj.name) 7744 if obj.storage_hard_limit_pct is not None: 7745 Writer.write_integer(writer, 'storage_hard_limit_pct', obj.storage_hard_limit_pct) 7746 if obj.storage_soft_limit_pct is not None: 7747 Writer.write_integer(writer, 'storage_soft_limit_pct', obj.storage_soft_limit_pct) 7748 if obj.users is not None: 7749 UserWriter.write_many(obj.users, writer, 'user', 'users') 7750 if obj.vms is not None: 7751 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 7752 if obj.permissions is not None: 7753 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 7754 if obj.quota_cluster_limits is not None: 7755 QuotaClusterLimitWriter.write_many(obj.quota_cluster_limits, writer, 'quota_cluster_limit', 'quota_cluster_limits') 7756 if obj.quota_storage_limits is not None: 7757 QuotaStorageLimitWriter.write_many(obj.quota_storage_limits, writer, 'quota_storage_limit', 'quota_storage_limits') 7758 writer.write_end()
7760 @staticmethod 7761 def write_many(objs, writer, singular=None, plural=None): 7762 if singular is None: 7763 singular = 'quota' 7764 if plural is None: 7765 plural = 'quotas' 7766 writer.write_start(plural) 7767 if isinstance(objs, List): 7768 href = objs.href 7769 if href is not None: 7770 writer.write_attribute('href', href) 7771 for obj in objs: 7772 QuotaWriter.write_one(obj, writer, singular) 7773 writer.write_end()
7776class QuotaClusterLimitWriter(Writer): 7777 7778 def __init__(self): 7779 super(QuotaClusterLimitWriter, self).__init__() 7780 7781 @staticmethod 7782 def write_one(obj, writer, singular=None): 7783 if singular is None: 7784 singular = 'quota_cluster_limit' 7785 writer.write_start(singular) 7786 href = obj.href 7787 if href is not None: 7788 writer.write_attribute('href', href) 7789 if obj.id is not None: 7790 writer.write_attribute('id', obj.id) 7791 if obj.comment is not None: 7792 Writer.write_string(writer, 'comment', obj.comment) 7793 if obj.description is not None: 7794 Writer.write_string(writer, 'description', obj.description) 7795 if obj.memory_limit is not None: 7796 Writer.write_decimal(writer, 'memory_limit', obj.memory_limit) 7797 if obj.memory_usage is not None: 7798 Writer.write_decimal(writer, 'memory_usage', obj.memory_usage) 7799 if obj.name is not None: 7800 Writer.write_string(writer, 'name', obj.name) 7801 if obj.vcpu_limit is not None: 7802 Writer.write_integer(writer, 'vcpu_limit', obj.vcpu_limit) 7803 if obj.vcpu_usage is not None: 7804 Writer.write_integer(writer, 'vcpu_usage', obj.vcpu_usage) 7805 if obj.cluster is not None: 7806 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 7807 if obj.quota is not None: 7808 QuotaWriter.write_one(obj.quota, writer, 'quota') 7809 writer.write_end() 7810 7811 @staticmethod 7812 def write_many(objs, writer, singular=None, plural=None): 7813 if singular is None: 7814 singular = 'quota_cluster_limit' 7815 if plural is None: 7816 plural = 'quota_cluster_limits' 7817 writer.write_start(plural) 7818 if isinstance(objs, List): 7819 href = objs.href 7820 if href is not None: 7821 writer.write_attribute('href', href) 7822 for obj in objs: 7823 QuotaClusterLimitWriter.write_one(obj, writer, singular) 7824 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7781 @staticmethod 7782 def write_one(obj, writer, singular=None): 7783 if singular is None: 7784 singular = 'quota_cluster_limit' 7785 writer.write_start(singular) 7786 href = obj.href 7787 if href is not None: 7788 writer.write_attribute('href', href) 7789 if obj.id is not None: 7790 writer.write_attribute('id', obj.id) 7791 if obj.comment is not None: 7792 Writer.write_string(writer, 'comment', obj.comment) 7793 if obj.description is not None: 7794 Writer.write_string(writer, 'description', obj.description) 7795 if obj.memory_limit is not None: 7796 Writer.write_decimal(writer, 'memory_limit', obj.memory_limit) 7797 if obj.memory_usage is not None: 7798 Writer.write_decimal(writer, 'memory_usage', obj.memory_usage) 7799 if obj.name is not None: 7800 Writer.write_string(writer, 'name', obj.name) 7801 if obj.vcpu_limit is not None: 7802 Writer.write_integer(writer, 'vcpu_limit', obj.vcpu_limit) 7803 if obj.vcpu_usage is not None: 7804 Writer.write_integer(writer, 'vcpu_usage', obj.vcpu_usage) 7805 if obj.cluster is not None: 7806 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 7807 if obj.quota is not None: 7808 QuotaWriter.write_one(obj.quota, writer, 'quota') 7809 writer.write_end()
7811 @staticmethod 7812 def write_many(objs, writer, singular=None, plural=None): 7813 if singular is None: 7814 singular = 'quota_cluster_limit' 7815 if plural is None: 7816 plural = 'quota_cluster_limits' 7817 writer.write_start(plural) 7818 if isinstance(objs, List): 7819 href = objs.href 7820 if href is not None: 7821 writer.write_attribute('href', href) 7822 for obj in objs: 7823 QuotaClusterLimitWriter.write_one(obj, writer, singular) 7824 writer.write_end()
7827class QuotaStorageLimitWriter(Writer): 7828 7829 def __init__(self): 7830 super(QuotaStorageLimitWriter, self).__init__() 7831 7832 @staticmethod 7833 def write_one(obj, writer, singular=None): 7834 if singular is None: 7835 singular = 'quota_storage_limit' 7836 writer.write_start(singular) 7837 href = obj.href 7838 if href is not None: 7839 writer.write_attribute('href', href) 7840 if obj.id is not None: 7841 writer.write_attribute('id', obj.id) 7842 if obj.comment is not None: 7843 Writer.write_string(writer, 'comment', obj.comment) 7844 if obj.description is not None: 7845 Writer.write_string(writer, 'description', obj.description) 7846 if obj.limit is not None: 7847 Writer.write_integer(writer, 'limit', obj.limit) 7848 if obj.name is not None: 7849 Writer.write_string(writer, 'name', obj.name) 7850 if obj.usage is not None: 7851 Writer.write_decimal(writer, 'usage', obj.usage) 7852 if obj.quota is not None: 7853 QuotaWriter.write_one(obj.quota, writer, 'quota') 7854 if obj.storage_domain is not None: 7855 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 7856 writer.write_end() 7857 7858 @staticmethod 7859 def write_many(objs, writer, singular=None, plural=None): 7860 if singular is None: 7861 singular = 'quota_storage_limit' 7862 if plural is None: 7863 plural = 'quota_storage_limits' 7864 writer.write_start(plural) 7865 if isinstance(objs, List): 7866 href = objs.href 7867 if href is not None: 7868 writer.write_attribute('href', href) 7869 for obj in objs: 7870 QuotaStorageLimitWriter.write_one(obj, writer, singular) 7871 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7832 @staticmethod 7833 def write_one(obj, writer, singular=None): 7834 if singular is None: 7835 singular = 'quota_storage_limit' 7836 writer.write_start(singular) 7837 href = obj.href 7838 if href is not None: 7839 writer.write_attribute('href', href) 7840 if obj.id is not None: 7841 writer.write_attribute('id', obj.id) 7842 if obj.comment is not None: 7843 Writer.write_string(writer, 'comment', obj.comment) 7844 if obj.description is not None: 7845 Writer.write_string(writer, 'description', obj.description) 7846 if obj.limit is not None: 7847 Writer.write_integer(writer, 'limit', obj.limit) 7848 if obj.name is not None: 7849 Writer.write_string(writer, 'name', obj.name) 7850 if obj.usage is not None: 7851 Writer.write_decimal(writer, 'usage', obj.usage) 7852 if obj.quota is not None: 7853 QuotaWriter.write_one(obj.quota, writer, 'quota') 7854 if obj.storage_domain is not None: 7855 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 7856 writer.write_end()
7858 @staticmethod 7859 def write_many(objs, writer, singular=None, plural=None): 7860 if singular is None: 7861 singular = 'quota_storage_limit' 7862 if plural is None: 7863 plural = 'quota_storage_limits' 7864 writer.write_start(plural) 7865 if isinstance(objs, List): 7866 href = objs.href 7867 if href is not None: 7868 writer.write_attribute('href', href) 7869 for obj in objs: 7870 QuotaStorageLimitWriter.write_one(obj, writer, singular) 7871 writer.write_end()
7874class RangeWriter(Writer): 7875 7876 def __init__(self): 7877 super(RangeWriter, self).__init__() 7878 7879 @staticmethod 7880 def write_one(obj, writer, singular=None): 7881 if singular is None: 7882 singular = 'range' 7883 writer.write_start(singular) 7884 href = obj.href 7885 if href is not None: 7886 writer.write_attribute('href', href) 7887 if obj.from_ is not None: 7888 Writer.write_string(writer, 'from', obj.from_) 7889 if obj.to is not None: 7890 Writer.write_string(writer, 'to', obj.to) 7891 writer.write_end() 7892 7893 @staticmethod 7894 def write_many(objs, writer, singular=None, plural=None): 7895 if singular is None: 7896 singular = 'range' 7897 if plural is None: 7898 plural = 'ranges' 7899 writer.write_start(plural) 7900 if isinstance(objs, List): 7901 href = objs.href 7902 if href is not None: 7903 writer.write_attribute('href', href) 7904 for obj in objs: 7905 RangeWriter.write_one(obj, writer, singular) 7906 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7879 @staticmethod 7880 def write_one(obj, writer, singular=None): 7881 if singular is None: 7882 singular = 'range' 7883 writer.write_start(singular) 7884 href = obj.href 7885 if href is not None: 7886 writer.write_attribute('href', href) 7887 if obj.from_ is not None: 7888 Writer.write_string(writer, 'from', obj.from_) 7889 if obj.to is not None: 7890 Writer.write_string(writer, 'to', obj.to) 7891 writer.write_end()
7893 @staticmethod 7894 def write_many(objs, writer, singular=None, plural=None): 7895 if singular is None: 7896 singular = 'range' 7897 if plural is None: 7898 plural = 'ranges' 7899 writer.write_start(plural) 7900 if isinstance(objs, List): 7901 href = objs.href 7902 if href is not None: 7903 writer.write_attribute('href', href) 7904 for obj in objs: 7905 RangeWriter.write_one(obj, writer, singular) 7906 writer.write_end()
7909class RateWriter(Writer): 7910 7911 def __init__(self): 7912 super(RateWriter, self).__init__() 7913 7914 @staticmethod 7915 def write_one(obj, writer, singular=None): 7916 if singular is None: 7917 singular = 'rate' 7918 writer.write_start(singular) 7919 href = obj.href 7920 if href is not None: 7921 writer.write_attribute('href', href) 7922 if obj.bytes is not None: 7923 Writer.write_integer(writer, 'bytes', obj.bytes) 7924 if obj.period is not None: 7925 Writer.write_integer(writer, 'period', obj.period) 7926 writer.write_end() 7927 7928 @staticmethod 7929 def write_many(objs, writer, singular=None, plural=None): 7930 if singular is None: 7931 singular = 'rate' 7932 if plural is None: 7933 plural = 'rates' 7934 writer.write_start(plural) 7935 if isinstance(objs, List): 7936 href = objs.href 7937 if href is not None: 7938 writer.write_attribute('href', href) 7939 for obj in objs: 7940 RateWriter.write_one(obj, writer, singular) 7941 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7914 @staticmethod 7915 def write_one(obj, writer, singular=None): 7916 if singular is None: 7917 singular = 'rate' 7918 writer.write_start(singular) 7919 href = obj.href 7920 if href is not None: 7921 writer.write_attribute('href', href) 7922 if obj.bytes is not None: 7923 Writer.write_integer(writer, 'bytes', obj.bytes) 7924 if obj.period is not None: 7925 Writer.write_integer(writer, 'period', obj.period) 7926 writer.write_end()
7928 @staticmethod 7929 def write_many(objs, writer, singular=None, plural=None): 7930 if singular is None: 7931 singular = 'rate' 7932 if plural is None: 7933 plural = 'rates' 7934 writer.write_start(plural) 7935 if isinstance(objs, List): 7936 href = objs.href 7937 if href is not None: 7938 writer.write_attribute('href', href) 7939 for obj in objs: 7940 RateWriter.write_one(obj, writer, singular) 7941 writer.write_end()
7944class RegistrationAffinityGroupMappingWriter(Writer): 7945 7946 def __init__(self): 7947 super(RegistrationAffinityGroupMappingWriter, self).__init__() 7948 7949 @staticmethod 7950 def write_one(obj, writer, singular=None): 7951 if singular is None: 7952 singular = 'registration_affinity_group_mapping' 7953 writer.write_start(singular) 7954 href = obj.href 7955 if href is not None: 7956 writer.write_attribute('href', href) 7957 if obj.from_ is not None: 7958 AffinityGroupWriter.write_one(obj.from_, writer, 'from') 7959 if obj.to is not None: 7960 AffinityGroupWriter.write_one(obj.to, writer, 'to') 7961 writer.write_end() 7962 7963 @staticmethod 7964 def write_many(objs, writer, singular=None, plural=None): 7965 if singular is None: 7966 singular = 'registration_affinity_group_mapping' 7967 if plural is None: 7968 plural = 'registration_affinity_group_mappings' 7969 writer.write_start(plural) 7970 if isinstance(objs, List): 7971 href = objs.href 7972 if href is not None: 7973 writer.write_attribute('href', href) 7974 for obj in objs: 7975 RegistrationAffinityGroupMappingWriter.write_one(obj, writer, singular) 7976 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7949 @staticmethod 7950 def write_one(obj, writer, singular=None): 7951 if singular is None: 7952 singular = 'registration_affinity_group_mapping' 7953 writer.write_start(singular) 7954 href = obj.href 7955 if href is not None: 7956 writer.write_attribute('href', href) 7957 if obj.from_ is not None: 7958 AffinityGroupWriter.write_one(obj.from_, writer, 'from') 7959 if obj.to is not None: 7960 AffinityGroupWriter.write_one(obj.to, writer, 'to') 7961 writer.write_end()
7963 @staticmethod 7964 def write_many(objs, writer, singular=None, plural=None): 7965 if singular is None: 7966 singular = 'registration_affinity_group_mapping' 7967 if plural is None: 7968 plural = 'registration_affinity_group_mappings' 7969 writer.write_start(plural) 7970 if isinstance(objs, List): 7971 href = objs.href 7972 if href is not None: 7973 writer.write_attribute('href', href) 7974 for obj in objs: 7975 RegistrationAffinityGroupMappingWriter.write_one(obj, writer, singular) 7976 writer.write_end()
7979class RegistrationAffinityLabelMappingWriter(Writer): 7980 7981 def __init__(self): 7982 super(RegistrationAffinityLabelMappingWriter, self).__init__() 7983 7984 @staticmethod 7985 def write_one(obj, writer, singular=None): 7986 if singular is None: 7987 singular = 'registration_affinity_label_mapping' 7988 writer.write_start(singular) 7989 href = obj.href 7990 if href is not None: 7991 writer.write_attribute('href', href) 7992 if obj.from_ is not None: 7993 AffinityLabelWriter.write_one(obj.from_, writer, 'from') 7994 if obj.to is not None: 7995 AffinityLabelWriter.write_one(obj.to, writer, 'to') 7996 writer.write_end() 7997 7998 @staticmethod 7999 def write_many(objs, writer, singular=None, plural=None): 8000 if singular is None: 8001 singular = 'registration_affinity_label_mapping' 8002 if plural is None: 8003 plural = 'registration_affinity_label_mappings' 8004 writer.write_start(plural) 8005 if isinstance(objs, List): 8006 href = objs.href 8007 if href is not None: 8008 writer.write_attribute('href', href) 8009 for obj in objs: 8010 RegistrationAffinityLabelMappingWriter.write_one(obj, writer, singular) 8011 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
7984 @staticmethod 7985 def write_one(obj, writer, singular=None): 7986 if singular is None: 7987 singular = 'registration_affinity_label_mapping' 7988 writer.write_start(singular) 7989 href = obj.href 7990 if href is not None: 7991 writer.write_attribute('href', href) 7992 if obj.from_ is not None: 7993 AffinityLabelWriter.write_one(obj.from_, writer, 'from') 7994 if obj.to is not None: 7995 AffinityLabelWriter.write_one(obj.to, writer, 'to') 7996 writer.write_end()
7998 @staticmethod 7999 def write_many(objs, writer, singular=None, plural=None): 8000 if singular is None: 8001 singular = 'registration_affinity_label_mapping' 8002 if plural is None: 8003 plural = 'registration_affinity_label_mappings' 8004 writer.write_start(plural) 8005 if isinstance(objs, List): 8006 href = objs.href 8007 if href is not None: 8008 writer.write_attribute('href', href) 8009 for obj in objs: 8010 RegistrationAffinityLabelMappingWriter.write_one(obj, writer, singular) 8011 writer.write_end()
8014class RegistrationClusterMappingWriter(Writer): 8015 8016 def __init__(self): 8017 super(RegistrationClusterMappingWriter, self).__init__() 8018 8019 @staticmethod 8020 def write_one(obj, writer, singular=None): 8021 if singular is None: 8022 singular = 'registration_cluster_mapping' 8023 writer.write_start(singular) 8024 href = obj.href 8025 if href is not None: 8026 writer.write_attribute('href', href) 8027 if obj.from_ is not None: 8028 ClusterWriter.write_one(obj.from_, writer, 'from') 8029 if obj.to is not None: 8030 ClusterWriter.write_one(obj.to, writer, 'to') 8031 writer.write_end() 8032 8033 @staticmethod 8034 def write_many(objs, writer, singular=None, plural=None): 8035 if singular is None: 8036 singular = 'registration_cluster_mapping' 8037 if plural is None: 8038 plural = 'registration_cluster_mappings' 8039 writer.write_start(plural) 8040 if isinstance(objs, List): 8041 href = objs.href 8042 if href is not None: 8043 writer.write_attribute('href', href) 8044 for obj in objs: 8045 RegistrationClusterMappingWriter.write_one(obj, writer, singular) 8046 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8019 @staticmethod 8020 def write_one(obj, writer, singular=None): 8021 if singular is None: 8022 singular = 'registration_cluster_mapping' 8023 writer.write_start(singular) 8024 href = obj.href 8025 if href is not None: 8026 writer.write_attribute('href', href) 8027 if obj.from_ is not None: 8028 ClusterWriter.write_one(obj.from_, writer, 'from') 8029 if obj.to is not None: 8030 ClusterWriter.write_one(obj.to, writer, 'to') 8031 writer.write_end()
8033 @staticmethod 8034 def write_many(objs, writer, singular=None, plural=None): 8035 if singular is None: 8036 singular = 'registration_cluster_mapping' 8037 if plural is None: 8038 plural = 'registration_cluster_mappings' 8039 writer.write_start(plural) 8040 if isinstance(objs, List): 8041 href = objs.href 8042 if href is not None: 8043 writer.write_attribute('href', href) 8044 for obj in objs: 8045 RegistrationClusterMappingWriter.write_one(obj, writer, singular) 8046 writer.write_end()
8049class RegistrationConfigurationWriter(Writer): 8050 8051 def __init__(self): 8052 super(RegistrationConfigurationWriter, self).__init__() 8053 8054 @staticmethod 8055 def write_one(obj, writer, singular=None): 8056 if singular is None: 8057 singular = 'registration_configuration' 8058 writer.write_start(singular) 8059 href = obj.href 8060 if href is not None: 8061 writer.write_attribute('href', href) 8062 if obj.affinity_group_mappings is not None: 8063 RegistrationAffinityGroupMappingWriter.write_many(obj.affinity_group_mappings, writer, 'registration_affinity_group_mapping', 'affinity_group_mappings') 8064 if obj.affinity_label_mappings is not None: 8065 RegistrationAffinityLabelMappingWriter.write_many(obj.affinity_label_mappings, writer, 'registration_affinity_label_mapping', 'affinity_label_mappings') 8066 if obj.cluster_mappings is not None: 8067 RegistrationClusterMappingWriter.write_many(obj.cluster_mappings, writer, 'registration_cluster_mapping', 'cluster_mappings') 8068 if obj.domain_mappings is not None: 8069 RegistrationDomainMappingWriter.write_many(obj.domain_mappings, writer, 'registration_domain_mapping', 'domain_mappings') 8070 if obj.lun_mappings is not None: 8071 RegistrationLunMappingWriter.write_many(obj.lun_mappings, writer, 'registration_lun_mapping', 'lun_mappings') 8072 if obj.role_mappings is not None: 8073 RegistrationRoleMappingWriter.write_many(obj.role_mappings, writer, 'registration_role_mapping', 'role_mappings') 8074 if obj.vnic_profile_mappings is not None: 8075 RegistrationVnicProfileMappingWriter.write_many(obj.vnic_profile_mappings, writer, 'registration_vnic_profile_mapping', 'vnic_profile_mappings') 8076 writer.write_end() 8077 8078 @staticmethod 8079 def write_many(objs, writer, singular=None, plural=None): 8080 if singular is None: 8081 singular = 'registration_configuration' 8082 if plural is None: 8083 plural = 'registration_configurations' 8084 writer.write_start(plural) 8085 if isinstance(objs, List): 8086 href = objs.href 8087 if href is not None: 8088 writer.write_attribute('href', href) 8089 for obj in objs: 8090 RegistrationConfigurationWriter.write_one(obj, writer, singular) 8091 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8054 @staticmethod 8055 def write_one(obj, writer, singular=None): 8056 if singular is None: 8057 singular = 'registration_configuration' 8058 writer.write_start(singular) 8059 href = obj.href 8060 if href is not None: 8061 writer.write_attribute('href', href) 8062 if obj.affinity_group_mappings is not None: 8063 RegistrationAffinityGroupMappingWriter.write_many(obj.affinity_group_mappings, writer, 'registration_affinity_group_mapping', 'affinity_group_mappings') 8064 if obj.affinity_label_mappings is not None: 8065 RegistrationAffinityLabelMappingWriter.write_many(obj.affinity_label_mappings, writer, 'registration_affinity_label_mapping', 'affinity_label_mappings') 8066 if obj.cluster_mappings is not None: 8067 RegistrationClusterMappingWriter.write_many(obj.cluster_mappings, writer, 'registration_cluster_mapping', 'cluster_mappings') 8068 if obj.domain_mappings is not None: 8069 RegistrationDomainMappingWriter.write_many(obj.domain_mappings, writer, 'registration_domain_mapping', 'domain_mappings') 8070 if obj.lun_mappings is not None: 8071 RegistrationLunMappingWriter.write_many(obj.lun_mappings, writer, 'registration_lun_mapping', 'lun_mappings') 8072 if obj.role_mappings is not None: 8073 RegistrationRoleMappingWriter.write_many(obj.role_mappings, writer, 'registration_role_mapping', 'role_mappings') 8074 if obj.vnic_profile_mappings is not None: 8075 RegistrationVnicProfileMappingWriter.write_many(obj.vnic_profile_mappings, writer, 'registration_vnic_profile_mapping', 'vnic_profile_mappings') 8076 writer.write_end()
8078 @staticmethod 8079 def write_many(objs, writer, singular=None, plural=None): 8080 if singular is None: 8081 singular = 'registration_configuration' 8082 if plural is None: 8083 plural = 'registration_configurations' 8084 writer.write_start(plural) 8085 if isinstance(objs, List): 8086 href = objs.href 8087 if href is not None: 8088 writer.write_attribute('href', href) 8089 for obj in objs: 8090 RegistrationConfigurationWriter.write_one(obj, writer, singular) 8091 writer.write_end()
8094class RegistrationDomainMappingWriter(Writer): 8095 8096 def __init__(self): 8097 super(RegistrationDomainMappingWriter, self).__init__() 8098 8099 @staticmethod 8100 def write_one(obj, writer, singular=None): 8101 if singular is None: 8102 singular = 'registration_domain_mapping' 8103 writer.write_start(singular) 8104 href = obj.href 8105 if href is not None: 8106 writer.write_attribute('href', href) 8107 if obj.from_ is not None: 8108 DomainWriter.write_one(obj.from_, writer, 'from') 8109 if obj.to is not None: 8110 DomainWriter.write_one(obj.to, writer, 'to') 8111 writer.write_end() 8112 8113 @staticmethod 8114 def write_many(objs, writer, singular=None, plural=None): 8115 if singular is None: 8116 singular = 'registration_domain_mapping' 8117 if plural is None: 8118 plural = 'registration_domain_mappings' 8119 writer.write_start(plural) 8120 if isinstance(objs, List): 8121 href = objs.href 8122 if href is not None: 8123 writer.write_attribute('href', href) 8124 for obj in objs: 8125 RegistrationDomainMappingWriter.write_one(obj, writer, singular) 8126 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8099 @staticmethod 8100 def write_one(obj, writer, singular=None): 8101 if singular is None: 8102 singular = 'registration_domain_mapping' 8103 writer.write_start(singular) 8104 href = obj.href 8105 if href is not None: 8106 writer.write_attribute('href', href) 8107 if obj.from_ is not None: 8108 DomainWriter.write_one(obj.from_, writer, 'from') 8109 if obj.to is not None: 8110 DomainWriter.write_one(obj.to, writer, 'to') 8111 writer.write_end()
8113 @staticmethod 8114 def write_many(objs, writer, singular=None, plural=None): 8115 if singular is None: 8116 singular = 'registration_domain_mapping' 8117 if plural is None: 8118 plural = 'registration_domain_mappings' 8119 writer.write_start(plural) 8120 if isinstance(objs, List): 8121 href = objs.href 8122 if href is not None: 8123 writer.write_attribute('href', href) 8124 for obj in objs: 8125 RegistrationDomainMappingWriter.write_one(obj, writer, singular) 8126 writer.write_end()
8129class RegistrationLunMappingWriter(Writer): 8130 8131 def __init__(self): 8132 super(RegistrationLunMappingWriter, self).__init__() 8133 8134 @staticmethod 8135 def write_one(obj, writer, singular=None): 8136 if singular is None: 8137 singular = 'registration_lun_mapping' 8138 writer.write_start(singular) 8139 href = obj.href 8140 if href is not None: 8141 writer.write_attribute('href', href) 8142 if obj.from_ is not None: 8143 DiskWriter.write_one(obj.from_, writer, 'from') 8144 if obj.to is not None: 8145 DiskWriter.write_one(obj.to, writer, 'to') 8146 writer.write_end() 8147 8148 @staticmethod 8149 def write_many(objs, writer, singular=None, plural=None): 8150 if singular is None: 8151 singular = 'registration_lun_mapping' 8152 if plural is None: 8153 plural = 'registration_lun_mappings' 8154 writer.write_start(plural) 8155 if isinstance(objs, List): 8156 href = objs.href 8157 if href is not None: 8158 writer.write_attribute('href', href) 8159 for obj in objs: 8160 RegistrationLunMappingWriter.write_one(obj, writer, singular) 8161 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8134 @staticmethod 8135 def write_one(obj, writer, singular=None): 8136 if singular is None: 8137 singular = 'registration_lun_mapping' 8138 writer.write_start(singular) 8139 href = obj.href 8140 if href is not None: 8141 writer.write_attribute('href', href) 8142 if obj.from_ is not None: 8143 DiskWriter.write_one(obj.from_, writer, 'from') 8144 if obj.to is not None: 8145 DiskWriter.write_one(obj.to, writer, 'to') 8146 writer.write_end()
8148 @staticmethod 8149 def write_many(objs, writer, singular=None, plural=None): 8150 if singular is None: 8151 singular = 'registration_lun_mapping' 8152 if plural is None: 8153 plural = 'registration_lun_mappings' 8154 writer.write_start(plural) 8155 if isinstance(objs, List): 8156 href = objs.href 8157 if href is not None: 8158 writer.write_attribute('href', href) 8159 for obj in objs: 8160 RegistrationLunMappingWriter.write_one(obj, writer, singular) 8161 writer.write_end()
8164class RegistrationRoleMappingWriter(Writer): 8165 8166 def __init__(self): 8167 super(RegistrationRoleMappingWriter, self).__init__() 8168 8169 @staticmethod 8170 def write_one(obj, writer, singular=None): 8171 if singular is None: 8172 singular = 'registration_role_mapping' 8173 writer.write_start(singular) 8174 href = obj.href 8175 if href is not None: 8176 writer.write_attribute('href', href) 8177 if obj.from_ is not None: 8178 RoleWriter.write_one(obj.from_, writer, 'from') 8179 if obj.to is not None: 8180 RoleWriter.write_one(obj.to, writer, 'to') 8181 writer.write_end() 8182 8183 @staticmethod 8184 def write_many(objs, writer, singular=None, plural=None): 8185 if singular is None: 8186 singular = 'registration_role_mapping' 8187 if plural is None: 8188 plural = 'registration_role_mappings' 8189 writer.write_start(plural) 8190 if isinstance(objs, List): 8191 href = objs.href 8192 if href is not None: 8193 writer.write_attribute('href', href) 8194 for obj in objs: 8195 RegistrationRoleMappingWriter.write_one(obj, writer, singular) 8196 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8169 @staticmethod 8170 def write_one(obj, writer, singular=None): 8171 if singular is None: 8172 singular = 'registration_role_mapping' 8173 writer.write_start(singular) 8174 href = obj.href 8175 if href is not None: 8176 writer.write_attribute('href', href) 8177 if obj.from_ is not None: 8178 RoleWriter.write_one(obj.from_, writer, 'from') 8179 if obj.to is not None: 8180 RoleWriter.write_one(obj.to, writer, 'to') 8181 writer.write_end()
8183 @staticmethod 8184 def write_many(objs, writer, singular=None, plural=None): 8185 if singular is None: 8186 singular = 'registration_role_mapping' 8187 if plural is None: 8188 plural = 'registration_role_mappings' 8189 writer.write_start(plural) 8190 if isinstance(objs, List): 8191 href = objs.href 8192 if href is not None: 8193 writer.write_attribute('href', href) 8194 for obj in objs: 8195 RegistrationRoleMappingWriter.write_one(obj, writer, singular) 8196 writer.write_end()
8199class RegistrationVnicProfileMappingWriter(Writer): 8200 8201 def __init__(self): 8202 super(RegistrationVnicProfileMappingWriter, self).__init__() 8203 8204 @staticmethod 8205 def write_one(obj, writer, singular=None): 8206 if singular is None: 8207 singular = 'registration_vnic_profile_mapping' 8208 writer.write_start(singular) 8209 href = obj.href 8210 if href is not None: 8211 writer.write_attribute('href', href) 8212 if obj.from_ is not None: 8213 VnicProfileWriter.write_one(obj.from_, writer, 'from') 8214 if obj.to is not None: 8215 VnicProfileWriter.write_one(obj.to, writer, 'to') 8216 writer.write_end() 8217 8218 @staticmethod 8219 def write_many(objs, writer, singular=None, plural=None): 8220 if singular is None: 8221 singular = 'registration_vnic_profile_mapping' 8222 if plural is None: 8223 plural = 'registration_vnic_profile_mappings' 8224 writer.write_start(plural) 8225 if isinstance(objs, List): 8226 href = objs.href 8227 if href is not None: 8228 writer.write_attribute('href', href) 8229 for obj in objs: 8230 RegistrationVnicProfileMappingWriter.write_one(obj, writer, singular) 8231 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8204 @staticmethod 8205 def write_one(obj, writer, singular=None): 8206 if singular is None: 8207 singular = 'registration_vnic_profile_mapping' 8208 writer.write_start(singular) 8209 href = obj.href 8210 if href is not None: 8211 writer.write_attribute('href', href) 8212 if obj.from_ is not None: 8213 VnicProfileWriter.write_one(obj.from_, writer, 'from') 8214 if obj.to is not None: 8215 VnicProfileWriter.write_one(obj.to, writer, 'to') 8216 writer.write_end()
8218 @staticmethod 8219 def write_many(objs, writer, singular=None, plural=None): 8220 if singular is None: 8221 singular = 'registration_vnic_profile_mapping' 8222 if plural is None: 8223 plural = 'registration_vnic_profile_mappings' 8224 writer.write_start(plural) 8225 if isinstance(objs, List): 8226 href = objs.href 8227 if href is not None: 8228 writer.write_attribute('href', href) 8229 for obj in objs: 8230 RegistrationVnicProfileMappingWriter.write_one(obj, writer, singular) 8231 writer.write_end()
8234class ReportedConfigurationWriter(Writer): 8235 8236 def __init__(self): 8237 super(ReportedConfigurationWriter, self).__init__() 8238 8239 @staticmethod 8240 def write_one(obj, writer, singular=None): 8241 if singular is None: 8242 singular = 'reported_configuration' 8243 writer.write_start(singular) 8244 href = obj.href 8245 if href is not None: 8246 writer.write_attribute('href', href) 8247 if obj.actual_value is not None: 8248 Writer.write_string(writer, 'actual_value', obj.actual_value) 8249 if obj.expected_value is not None: 8250 Writer.write_string(writer, 'expected_value', obj.expected_value) 8251 if obj.in_sync is not None: 8252 Writer.write_boolean(writer, 'in_sync', obj.in_sync) 8253 if obj.name is not None: 8254 Writer.write_string(writer, 'name', obj.name) 8255 writer.write_end() 8256 8257 @staticmethod 8258 def write_many(objs, writer, singular=None, plural=None): 8259 if singular is None: 8260 singular = 'reported_configuration' 8261 if plural is None: 8262 plural = 'reported_configurations' 8263 writer.write_start(plural) 8264 if isinstance(objs, List): 8265 href = objs.href 8266 if href is not None: 8267 writer.write_attribute('href', href) 8268 for obj in objs: 8269 ReportedConfigurationWriter.write_one(obj, writer, singular) 8270 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8239 @staticmethod 8240 def write_one(obj, writer, singular=None): 8241 if singular is None: 8242 singular = 'reported_configuration' 8243 writer.write_start(singular) 8244 href = obj.href 8245 if href is not None: 8246 writer.write_attribute('href', href) 8247 if obj.actual_value is not None: 8248 Writer.write_string(writer, 'actual_value', obj.actual_value) 8249 if obj.expected_value is not None: 8250 Writer.write_string(writer, 'expected_value', obj.expected_value) 8251 if obj.in_sync is not None: 8252 Writer.write_boolean(writer, 'in_sync', obj.in_sync) 8253 if obj.name is not None: 8254 Writer.write_string(writer, 'name', obj.name) 8255 writer.write_end()
8257 @staticmethod 8258 def write_many(objs, writer, singular=None, plural=None): 8259 if singular is None: 8260 singular = 'reported_configuration' 8261 if plural is None: 8262 plural = 'reported_configurations' 8263 writer.write_start(plural) 8264 if isinstance(objs, List): 8265 href = objs.href 8266 if href is not None: 8267 writer.write_attribute('href', href) 8268 for obj in objs: 8269 ReportedConfigurationWriter.write_one(obj, writer, singular) 8270 writer.write_end()
8273class ReportedDeviceWriter(Writer): 8274 8275 def __init__(self): 8276 super(ReportedDeviceWriter, self).__init__() 8277 8278 @staticmethod 8279 def write_one(obj, writer, singular=None): 8280 if singular is None: 8281 singular = 'reported_device' 8282 writer.write_start(singular) 8283 href = obj.href 8284 if href is not None: 8285 writer.write_attribute('href', href) 8286 if obj.id is not None: 8287 writer.write_attribute('id', obj.id) 8288 if obj.comment is not None: 8289 Writer.write_string(writer, 'comment', obj.comment) 8290 if obj.description is not None: 8291 Writer.write_string(writer, 'description', obj.description) 8292 if obj.ips is not None: 8293 IpWriter.write_many(obj.ips, writer, 'ip', 'ips') 8294 if obj.mac is not None: 8295 MacWriter.write_one(obj.mac, writer, 'mac') 8296 if obj.name is not None: 8297 Writer.write_string(writer, 'name', obj.name) 8298 if obj.type is not None: 8299 Writer.write_string(writer, 'type', obj.type.value) 8300 if obj.vm is not None: 8301 VmWriter.write_one(obj.vm, writer, 'vm') 8302 writer.write_end() 8303 8304 @staticmethod 8305 def write_many(objs, writer, singular=None, plural=None): 8306 if singular is None: 8307 singular = 'reported_device' 8308 if plural is None: 8309 plural = 'reported_devices' 8310 writer.write_start(plural) 8311 if isinstance(objs, List): 8312 href = objs.href 8313 if href is not None: 8314 writer.write_attribute('href', href) 8315 for obj in objs: 8316 ReportedDeviceWriter.write_one(obj, writer, singular) 8317 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8278 @staticmethod 8279 def write_one(obj, writer, singular=None): 8280 if singular is None: 8281 singular = 'reported_device' 8282 writer.write_start(singular) 8283 href = obj.href 8284 if href is not None: 8285 writer.write_attribute('href', href) 8286 if obj.id is not None: 8287 writer.write_attribute('id', obj.id) 8288 if obj.comment is not None: 8289 Writer.write_string(writer, 'comment', obj.comment) 8290 if obj.description is not None: 8291 Writer.write_string(writer, 'description', obj.description) 8292 if obj.ips is not None: 8293 IpWriter.write_many(obj.ips, writer, 'ip', 'ips') 8294 if obj.mac is not None: 8295 MacWriter.write_one(obj.mac, writer, 'mac') 8296 if obj.name is not None: 8297 Writer.write_string(writer, 'name', obj.name) 8298 if obj.type is not None: 8299 Writer.write_string(writer, 'type', obj.type.value) 8300 if obj.vm is not None: 8301 VmWriter.write_one(obj.vm, writer, 'vm') 8302 writer.write_end()
8304 @staticmethod 8305 def write_many(objs, writer, singular=None, plural=None): 8306 if singular is None: 8307 singular = 'reported_device' 8308 if plural is None: 8309 plural = 'reported_devices' 8310 writer.write_start(plural) 8311 if isinstance(objs, List): 8312 href = objs.href 8313 if href is not None: 8314 writer.write_attribute('href', href) 8315 for obj in objs: 8316 ReportedDeviceWriter.write_one(obj, writer, singular) 8317 writer.write_end()
8320class RngDeviceWriter(Writer): 8321 8322 def __init__(self): 8323 super(RngDeviceWriter, self).__init__() 8324 8325 @staticmethod 8326 def write_one(obj, writer, singular=None): 8327 if singular is None: 8328 singular = 'rng_device' 8329 writer.write_start(singular) 8330 href = obj.href 8331 if href is not None: 8332 writer.write_attribute('href', href) 8333 if obj.rate is not None: 8334 RateWriter.write_one(obj.rate, writer, 'rate') 8335 if obj.source is not None: 8336 Writer.write_string(writer, 'source', obj.source.value) 8337 writer.write_end() 8338 8339 @staticmethod 8340 def write_many(objs, writer, singular=None, plural=None): 8341 if singular is None: 8342 singular = 'rng_device' 8343 if plural is None: 8344 plural = 'rng_devices' 8345 writer.write_start(plural) 8346 if isinstance(objs, List): 8347 href = objs.href 8348 if href is not None: 8349 writer.write_attribute('href', href) 8350 for obj in objs: 8351 RngDeviceWriter.write_one(obj, writer, singular) 8352 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8325 @staticmethod 8326 def write_one(obj, writer, singular=None): 8327 if singular is None: 8328 singular = 'rng_device' 8329 writer.write_start(singular) 8330 href = obj.href 8331 if href is not None: 8332 writer.write_attribute('href', href) 8333 if obj.rate is not None: 8334 RateWriter.write_one(obj.rate, writer, 'rate') 8335 if obj.source is not None: 8336 Writer.write_string(writer, 'source', obj.source.value) 8337 writer.write_end()
8339 @staticmethod 8340 def write_many(objs, writer, singular=None, plural=None): 8341 if singular is None: 8342 singular = 'rng_device' 8343 if plural is None: 8344 plural = 'rng_devices' 8345 writer.write_start(plural) 8346 if isinstance(objs, List): 8347 href = objs.href 8348 if href is not None: 8349 writer.write_attribute('href', href) 8350 for obj in objs: 8351 RngDeviceWriter.write_one(obj, writer, singular) 8352 writer.write_end()
8355class RoleWriter(Writer): 8356 8357 def __init__(self): 8358 super(RoleWriter, self).__init__() 8359 8360 @staticmethod 8361 def write_one(obj, writer, singular=None): 8362 if singular is None: 8363 singular = 'role' 8364 writer.write_start(singular) 8365 href = obj.href 8366 if href is not None: 8367 writer.write_attribute('href', href) 8368 if obj.id is not None: 8369 writer.write_attribute('id', obj.id) 8370 if obj.administrative is not None: 8371 Writer.write_boolean(writer, 'administrative', obj.administrative) 8372 if obj.comment is not None: 8373 Writer.write_string(writer, 'comment', obj.comment) 8374 if obj.description is not None: 8375 Writer.write_string(writer, 'description', obj.description) 8376 if obj.mutable is not None: 8377 Writer.write_boolean(writer, 'mutable', obj.mutable) 8378 if obj.name is not None: 8379 Writer.write_string(writer, 'name', obj.name) 8380 if obj.permits is not None: 8381 PermitWriter.write_many(obj.permits, writer, 'permit', 'permits') 8382 if obj.user is not None: 8383 UserWriter.write_one(obj.user, writer, 'user') 8384 writer.write_end() 8385 8386 @staticmethod 8387 def write_many(objs, writer, singular=None, plural=None): 8388 if singular is None: 8389 singular = 'role' 8390 if plural is None: 8391 plural = 'roles' 8392 writer.write_start(plural) 8393 if isinstance(objs, List): 8394 href = objs.href 8395 if href is not None: 8396 writer.write_attribute('href', href) 8397 for obj in objs: 8398 RoleWriter.write_one(obj, writer, singular) 8399 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8360 @staticmethod 8361 def write_one(obj, writer, singular=None): 8362 if singular is None: 8363 singular = 'role' 8364 writer.write_start(singular) 8365 href = obj.href 8366 if href is not None: 8367 writer.write_attribute('href', href) 8368 if obj.id is not None: 8369 writer.write_attribute('id', obj.id) 8370 if obj.administrative is not None: 8371 Writer.write_boolean(writer, 'administrative', obj.administrative) 8372 if obj.comment is not None: 8373 Writer.write_string(writer, 'comment', obj.comment) 8374 if obj.description is not None: 8375 Writer.write_string(writer, 'description', obj.description) 8376 if obj.mutable is not None: 8377 Writer.write_boolean(writer, 'mutable', obj.mutable) 8378 if obj.name is not None: 8379 Writer.write_string(writer, 'name', obj.name) 8380 if obj.permits is not None: 8381 PermitWriter.write_many(obj.permits, writer, 'permit', 'permits') 8382 if obj.user is not None: 8383 UserWriter.write_one(obj.user, writer, 'user') 8384 writer.write_end()
8386 @staticmethod 8387 def write_many(objs, writer, singular=None, plural=None): 8388 if singular is None: 8389 singular = 'role' 8390 if plural is None: 8391 plural = 'roles' 8392 writer.write_start(plural) 8393 if isinstance(objs, List): 8394 href = objs.href 8395 if href is not None: 8396 writer.write_attribute('href', href) 8397 for obj in objs: 8398 RoleWriter.write_one(obj, writer, singular) 8399 writer.write_end()
8402class SchedulingPolicyWriter(Writer): 8403 8404 def __init__(self): 8405 super(SchedulingPolicyWriter, self).__init__() 8406 8407 @staticmethod 8408 def write_one(obj, writer, singular=None): 8409 if singular is None: 8410 singular = 'scheduling_policy' 8411 writer.write_start(singular) 8412 href = obj.href 8413 if href is not None: 8414 writer.write_attribute('href', href) 8415 if obj.id is not None: 8416 writer.write_attribute('id', obj.id) 8417 if obj.comment is not None: 8418 Writer.write_string(writer, 'comment', obj.comment) 8419 if obj.default_policy is not None: 8420 Writer.write_boolean(writer, 'default_policy', obj.default_policy) 8421 if obj.description is not None: 8422 Writer.write_string(writer, 'description', obj.description) 8423 if obj.locked is not None: 8424 Writer.write_boolean(writer, 'locked', obj.locked) 8425 if obj.name is not None: 8426 Writer.write_string(writer, 'name', obj.name) 8427 if obj.properties is not None: 8428 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 8429 if obj.balances is not None: 8430 BalanceWriter.write_many(obj.balances, writer, 'balance', 'balances') 8431 if obj.filters is not None: 8432 FilterWriter.write_many(obj.filters, writer, 'filter', 'filters') 8433 if obj.weight is not None: 8434 WeightWriter.write_many(obj.weight, writer, 'weight', 'weight') 8435 writer.write_end() 8436 8437 @staticmethod 8438 def write_many(objs, writer, singular=None, plural=None): 8439 if singular is None: 8440 singular = 'scheduling_policy' 8441 if plural is None: 8442 plural = 'scheduling_policies' 8443 writer.write_start(plural) 8444 if isinstance(objs, List): 8445 href = objs.href 8446 if href is not None: 8447 writer.write_attribute('href', href) 8448 for obj in objs: 8449 SchedulingPolicyWriter.write_one(obj, writer, singular) 8450 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8407 @staticmethod 8408 def write_one(obj, writer, singular=None): 8409 if singular is None: 8410 singular = 'scheduling_policy' 8411 writer.write_start(singular) 8412 href = obj.href 8413 if href is not None: 8414 writer.write_attribute('href', href) 8415 if obj.id is not None: 8416 writer.write_attribute('id', obj.id) 8417 if obj.comment is not None: 8418 Writer.write_string(writer, 'comment', obj.comment) 8419 if obj.default_policy is not None: 8420 Writer.write_boolean(writer, 'default_policy', obj.default_policy) 8421 if obj.description is not None: 8422 Writer.write_string(writer, 'description', obj.description) 8423 if obj.locked is not None: 8424 Writer.write_boolean(writer, 'locked', obj.locked) 8425 if obj.name is not None: 8426 Writer.write_string(writer, 'name', obj.name) 8427 if obj.properties is not None: 8428 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 8429 if obj.balances is not None: 8430 BalanceWriter.write_many(obj.balances, writer, 'balance', 'balances') 8431 if obj.filters is not None: 8432 FilterWriter.write_many(obj.filters, writer, 'filter', 'filters') 8433 if obj.weight is not None: 8434 WeightWriter.write_many(obj.weight, writer, 'weight', 'weight') 8435 writer.write_end()
8437 @staticmethod 8438 def write_many(objs, writer, singular=None, plural=None): 8439 if singular is None: 8440 singular = 'scheduling_policy' 8441 if plural is None: 8442 plural = 'scheduling_policies' 8443 writer.write_start(plural) 8444 if isinstance(objs, List): 8445 href = objs.href 8446 if href is not None: 8447 writer.write_attribute('href', href) 8448 for obj in objs: 8449 SchedulingPolicyWriter.write_one(obj, writer, singular) 8450 writer.write_end()
8453class SchedulingPolicyUnitWriter(Writer): 8454 8455 def __init__(self): 8456 super(SchedulingPolicyUnitWriter, self).__init__() 8457 8458 @staticmethod 8459 def write_one(obj, writer, singular=None): 8460 if singular is None: 8461 singular = 'scheduling_policy_unit' 8462 writer.write_start(singular) 8463 href = obj.href 8464 if href is not None: 8465 writer.write_attribute('href', href) 8466 if obj.id is not None: 8467 writer.write_attribute('id', obj.id) 8468 if obj.comment is not None: 8469 Writer.write_string(writer, 'comment', obj.comment) 8470 if obj.description is not None: 8471 Writer.write_string(writer, 'description', obj.description) 8472 if obj.enabled is not None: 8473 Writer.write_boolean(writer, 'enabled', obj.enabled) 8474 if obj.internal is not None: 8475 Writer.write_boolean(writer, 'internal', obj.internal) 8476 if obj.name is not None: 8477 Writer.write_string(writer, 'name', obj.name) 8478 if obj.properties is not None: 8479 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 8480 if obj.type is not None: 8481 Writer.write_string(writer, 'type', obj.type.value) 8482 writer.write_end() 8483 8484 @staticmethod 8485 def write_many(objs, writer, singular=None, plural=None): 8486 if singular is None: 8487 singular = 'scheduling_policy_unit' 8488 if plural is None: 8489 plural = 'scheduling_policy_units' 8490 writer.write_start(plural) 8491 if isinstance(objs, List): 8492 href = objs.href 8493 if href is not None: 8494 writer.write_attribute('href', href) 8495 for obj in objs: 8496 SchedulingPolicyUnitWriter.write_one(obj, writer, singular) 8497 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8458 @staticmethod 8459 def write_one(obj, writer, singular=None): 8460 if singular is None: 8461 singular = 'scheduling_policy_unit' 8462 writer.write_start(singular) 8463 href = obj.href 8464 if href is not None: 8465 writer.write_attribute('href', href) 8466 if obj.id is not None: 8467 writer.write_attribute('id', obj.id) 8468 if obj.comment is not None: 8469 Writer.write_string(writer, 'comment', obj.comment) 8470 if obj.description is not None: 8471 Writer.write_string(writer, 'description', obj.description) 8472 if obj.enabled is not None: 8473 Writer.write_boolean(writer, 'enabled', obj.enabled) 8474 if obj.internal is not None: 8475 Writer.write_boolean(writer, 'internal', obj.internal) 8476 if obj.name is not None: 8477 Writer.write_string(writer, 'name', obj.name) 8478 if obj.properties is not None: 8479 PropertyWriter.write_many(obj.properties, writer, 'property', 'properties') 8480 if obj.type is not None: 8481 Writer.write_string(writer, 'type', obj.type.value) 8482 writer.write_end()
8484 @staticmethod 8485 def write_many(objs, writer, singular=None, plural=None): 8486 if singular is None: 8487 singular = 'scheduling_policy_unit' 8488 if plural is None: 8489 plural = 'scheduling_policy_units' 8490 writer.write_start(plural) 8491 if isinstance(objs, List): 8492 href = objs.href 8493 if href is not None: 8494 writer.write_attribute('href', href) 8495 for obj in objs: 8496 SchedulingPolicyUnitWriter.write_one(obj, writer, singular) 8497 writer.write_end()
8500class SeLinuxWriter(Writer): 8501 8502 def __init__(self): 8503 super(SeLinuxWriter, self).__init__() 8504 8505 @staticmethod 8506 def write_one(obj, writer, singular=None): 8507 if singular is None: 8508 singular = 'se_linux' 8509 writer.write_start(singular) 8510 href = obj.href 8511 if href is not None: 8512 writer.write_attribute('href', href) 8513 if obj.mode is not None: 8514 Writer.write_string(writer, 'mode', obj.mode.value) 8515 writer.write_end() 8516 8517 @staticmethod 8518 def write_many(objs, writer, singular=None, plural=None): 8519 if singular is None: 8520 singular = 'se_linux' 8521 if plural is None: 8522 plural = 'se_linuxs' 8523 writer.write_start(plural) 8524 if isinstance(objs, List): 8525 href = objs.href 8526 if href is not None: 8527 writer.write_attribute('href', href) 8528 for obj in objs: 8529 SeLinuxWriter.write_one(obj, writer, singular) 8530 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8505 @staticmethod 8506 def write_one(obj, writer, singular=None): 8507 if singular is None: 8508 singular = 'se_linux' 8509 writer.write_start(singular) 8510 href = obj.href 8511 if href is not None: 8512 writer.write_attribute('href', href) 8513 if obj.mode is not None: 8514 Writer.write_string(writer, 'mode', obj.mode.value) 8515 writer.write_end()
8517 @staticmethod 8518 def write_many(objs, writer, singular=None, plural=None): 8519 if singular is None: 8520 singular = 'se_linux' 8521 if plural is None: 8522 plural = 'se_linuxs' 8523 writer.write_start(plural) 8524 if isinstance(objs, List): 8525 href = objs.href 8526 if href is not None: 8527 writer.write_attribute('href', href) 8528 for obj in objs: 8529 SeLinuxWriter.write_one(obj, writer, singular) 8530 writer.write_end()
8533class SerialNumberWriter(Writer): 8534 8535 def __init__(self): 8536 super(SerialNumberWriter, self).__init__() 8537 8538 @staticmethod 8539 def write_one(obj, writer, singular=None): 8540 if singular is None: 8541 singular = 'serial_number' 8542 writer.write_start(singular) 8543 href = obj.href 8544 if href is not None: 8545 writer.write_attribute('href', href) 8546 if obj.policy is not None: 8547 Writer.write_string(writer, 'policy', obj.policy.value) 8548 if obj.value is not None: 8549 Writer.write_string(writer, 'value', obj.value) 8550 writer.write_end() 8551 8552 @staticmethod 8553 def write_many(objs, writer, singular=None, plural=None): 8554 if singular is None: 8555 singular = 'serial_number' 8556 if plural is None: 8557 plural = 'serial_numbers' 8558 writer.write_start(plural) 8559 if isinstance(objs, List): 8560 href = objs.href 8561 if href is not None: 8562 writer.write_attribute('href', href) 8563 for obj in objs: 8564 SerialNumberWriter.write_one(obj, writer, singular) 8565 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8538 @staticmethod 8539 def write_one(obj, writer, singular=None): 8540 if singular is None: 8541 singular = 'serial_number' 8542 writer.write_start(singular) 8543 href = obj.href 8544 if href is not None: 8545 writer.write_attribute('href', href) 8546 if obj.policy is not None: 8547 Writer.write_string(writer, 'policy', obj.policy.value) 8548 if obj.value is not None: 8549 Writer.write_string(writer, 'value', obj.value) 8550 writer.write_end()
8552 @staticmethod 8553 def write_many(objs, writer, singular=None, plural=None): 8554 if singular is None: 8555 singular = 'serial_number' 8556 if plural is None: 8557 plural = 'serial_numbers' 8558 writer.write_start(plural) 8559 if isinstance(objs, List): 8560 href = objs.href 8561 if href is not None: 8562 writer.write_attribute('href', href) 8563 for obj in objs: 8564 SerialNumberWriter.write_one(obj, writer, singular) 8565 writer.write_end()
8568class SessionWriter(Writer): 8569 8570 def __init__(self): 8571 super(SessionWriter, self).__init__() 8572 8573 @staticmethod 8574 def write_one(obj, writer, singular=None): 8575 if singular is None: 8576 singular = 'session' 8577 writer.write_start(singular) 8578 href = obj.href 8579 if href is not None: 8580 writer.write_attribute('href', href) 8581 if obj.id is not None: 8582 writer.write_attribute('id', obj.id) 8583 if obj.comment is not None: 8584 Writer.write_string(writer, 'comment', obj.comment) 8585 if obj.console_user is not None: 8586 Writer.write_boolean(writer, 'console_user', obj.console_user) 8587 if obj.description is not None: 8588 Writer.write_string(writer, 'description', obj.description) 8589 if obj.ip is not None: 8590 IpWriter.write_one(obj.ip, writer, 'ip') 8591 if obj.name is not None: 8592 Writer.write_string(writer, 'name', obj.name) 8593 if obj.protocol is not None: 8594 Writer.write_string(writer, 'protocol', obj.protocol) 8595 if obj.user is not None: 8596 UserWriter.write_one(obj.user, writer, 'user') 8597 if obj.vm is not None: 8598 VmWriter.write_one(obj.vm, writer, 'vm') 8599 writer.write_end() 8600 8601 @staticmethod 8602 def write_many(objs, writer, singular=None, plural=None): 8603 if singular is None: 8604 singular = 'session' 8605 if plural is None: 8606 plural = 'sessions' 8607 writer.write_start(plural) 8608 if isinstance(objs, List): 8609 href = objs.href 8610 if href is not None: 8611 writer.write_attribute('href', href) 8612 for obj in objs: 8613 SessionWriter.write_one(obj, writer, singular) 8614 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8573 @staticmethod 8574 def write_one(obj, writer, singular=None): 8575 if singular is None: 8576 singular = 'session' 8577 writer.write_start(singular) 8578 href = obj.href 8579 if href is not None: 8580 writer.write_attribute('href', href) 8581 if obj.id is not None: 8582 writer.write_attribute('id', obj.id) 8583 if obj.comment is not None: 8584 Writer.write_string(writer, 'comment', obj.comment) 8585 if obj.console_user is not None: 8586 Writer.write_boolean(writer, 'console_user', obj.console_user) 8587 if obj.description is not None: 8588 Writer.write_string(writer, 'description', obj.description) 8589 if obj.ip is not None: 8590 IpWriter.write_one(obj.ip, writer, 'ip') 8591 if obj.name is not None: 8592 Writer.write_string(writer, 'name', obj.name) 8593 if obj.protocol is not None: 8594 Writer.write_string(writer, 'protocol', obj.protocol) 8595 if obj.user is not None: 8596 UserWriter.write_one(obj.user, writer, 'user') 8597 if obj.vm is not None: 8598 VmWriter.write_one(obj.vm, writer, 'vm') 8599 writer.write_end()
8601 @staticmethod 8602 def write_many(objs, writer, singular=None, plural=None): 8603 if singular is None: 8604 singular = 'session' 8605 if plural is None: 8606 plural = 'sessions' 8607 writer.write_start(plural) 8608 if isinstance(objs, List): 8609 href = objs.href 8610 if href is not None: 8611 writer.write_attribute('href', href) 8612 for obj in objs: 8613 SessionWriter.write_one(obj, writer, singular) 8614 writer.write_end()
8617class SkipIfConnectivityBrokenWriter(Writer): 8618 8619 def __init__(self): 8620 super(SkipIfConnectivityBrokenWriter, self).__init__() 8621 8622 @staticmethod 8623 def write_one(obj, writer, singular=None): 8624 if singular is None: 8625 singular = 'skip_if_connectivity_broken' 8626 writer.write_start(singular) 8627 href = obj.href 8628 if href is not None: 8629 writer.write_attribute('href', href) 8630 if obj.enabled is not None: 8631 Writer.write_boolean(writer, 'enabled', obj.enabled) 8632 if obj.threshold is not None: 8633 Writer.write_integer(writer, 'threshold', obj.threshold) 8634 writer.write_end() 8635 8636 @staticmethod 8637 def write_many(objs, writer, singular=None, plural=None): 8638 if singular is None: 8639 singular = 'skip_if_connectivity_broken' 8640 if plural is None: 8641 plural = 'skip_if_connectivity_brokens' 8642 writer.write_start(plural) 8643 if isinstance(objs, List): 8644 href = objs.href 8645 if href is not None: 8646 writer.write_attribute('href', href) 8647 for obj in objs: 8648 SkipIfConnectivityBrokenWriter.write_one(obj, writer, singular) 8649 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8622 @staticmethod 8623 def write_one(obj, writer, singular=None): 8624 if singular is None: 8625 singular = 'skip_if_connectivity_broken' 8626 writer.write_start(singular) 8627 href = obj.href 8628 if href is not None: 8629 writer.write_attribute('href', href) 8630 if obj.enabled is not None: 8631 Writer.write_boolean(writer, 'enabled', obj.enabled) 8632 if obj.threshold is not None: 8633 Writer.write_integer(writer, 'threshold', obj.threshold) 8634 writer.write_end()
8636 @staticmethod 8637 def write_many(objs, writer, singular=None, plural=None): 8638 if singular is None: 8639 singular = 'skip_if_connectivity_broken' 8640 if plural is None: 8641 plural = 'skip_if_connectivity_brokens' 8642 writer.write_start(plural) 8643 if isinstance(objs, List): 8644 href = objs.href 8645 if href is not None: 8646 writer.write_attribute('href', href) 8647 for obj in objs: 8648 SkipIfConnectivityBrokenWriter.write_one(obj, writer, singular) 8649 writer.write_end()
8652class SkipIfSdActiveWriter(Writer): 8653 8654 def __init__(self): 8655 super(SkipIfSdActiveWriter, self).__init__() 8656 8657 @staticmethod 8658 def write_one(obj, writer, singular=None): 8659 if singular is None: 8660 singular = 'skip_if_sd_active' 8661 writer.write_start(singular) 8662 href = obj.href 8663 if href is not None: 8664 writer.write_attribute('href', href) 8665 if obj.enabled is not None: 8666 Writer.write_boolean(writer, 'enabled', obj.enabled) 8667 writer.write_end() 8668 8669 @staticmethod 8670 def write_many(objs, writer, singular=None, plural=None): 8671 if singular is None: 8672 singular = 'skip_if_sd_active' 8673 if plural is None: 8674 plural = 'skip_if_sd_actives' 8675 writer.write_start(plural) 8676 if isinstance(objs, List): 8677 href = objs.href 8678 if href is not None: 8679 writer.write_attribute('href', href) 8680 for obj in objs: 8681 SkipIfSdActiveWriter.write_one(obj, writer, singular) 8682 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8657 @staticmethod 8658 def write_one(obj, writer, singular=None): 8659 if singular is None: 8660 singular = 'skip_if_sd_active' 8661 writer.write_start(singular) 8662 href = obj.href 8663 if href is not None: 8664 writer.write_attribute('href', href) 8665 if obj.enabled is not None: 8666 Writer.write_boolean(writer, 'enabled', obj.enabled) 8667 writer.write_end()
8669 @staticmethod 8670 def write_many(objs, writer, singular=None, plural=None): 8671 if singular is None: 8672 singular = 'skip_if_sd_active' 8673 if plural is None: 8674 plural = 'skip_if_sd_actives' 8675 writer.write_start(plural) 8676 if isinstance(objs, List): 8677 href = objs.href 8678 if href is not None: 8679 writer.write_attribute('href', href) 8680 for obj in objs: 8681 SkipIfSdActiveWriter.write_one(obj, writer, singular) 8682 writer.write_end()
8685class SnapshotWriter(Writer): 8686 8687 def __init__(self): 8688 super(SnapshotWriter, self).__init__() 8689 8690 @staticmethod 8691 def write_one(obj, writer, singular=None): 8692 if singular is None: 8693 singular = 'snapshot' 8694 writer.write_start(singular) 8695 href = obj.href 8696 if href is not None: 8697 writer.write_attribute('href', href) 8698 if obj.id is not None: 8699 writer.write_attribute('id', obj.id) 8700 if obj.auto_pinning_policy is not None: 8701 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 8702 if obj.bios is not None: 8703 BiosWriter.write_one(obj.bios, writer, 'bios') 8704 if obj.comment is not None: 8705 Writer.write_string(writer, 'comment', obj.comment) 8706 if obj.console is not None: 8707 ConsoleWriter.write_one(obj.console, writer, 'console') 8708 if obj.cpu is not None: 8709 CpuWriter.write_one(obj.cpu, writer, 'cpu') 8710 if obj.cpu_pinning_policy is not None: 8711 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 8712 if obj.cpu_shares is not None: 8713 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 8714 if obj.creation_time is not None: 8715 Writer.write_date(writer, 'creation_time', obj.creation_time) 8716 if obj.custom_compatibility_version is not None: 8717 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 8718 if obj.custom_cpu_model is not None: 8719 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 8720 if obj.custom_emulated_machine is not None: 8721 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 8722 if obj.custom_properties is not None: 8723 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 8724 if obj.date is not None: 8725 Writer.write_date(writer, 'date', obj.date) 8726 if obj.delete_protected is not None: 8727 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 8728 if obj.description is not None: 8729 Writer.write_string(writer, 'description', obj.description) 8730 if obj.display is not None: 8731 DisplayWriter.write_one(obj.display, writer, 'display') 8732 if obj.domain is not None: 8733 DomainWriter.write_one(obj.domain, writer, 'domain') 8734 if obj.fqdn is not None: 8735 Writer.write_string(writer, 'fqdn', obj.fqdn) 8736 if obj.guest_operating_system is not None: 8737 GuestOperatingSystemWriter.write_one(obj.guest_operating_system, writer, 'guest_operating_system') 8738 if obj.guest_time_zone is not None: 8739 TimeZoneWriter.write_one(obj.guest_time_zone, writer, 'guest_time_zone') 8740 if obj.has_illegal_images is not None: 8741 Writer.write_boolean(writer, 'has_illegal_images', obj.has_illegal_images) 8742 if obj.high_availability is not None: 8743 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 8744 if obj.initialization is not None: 8745 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 8746 if obj.io is not None: 8747 IoWriter.write_one(obj.io, writer, 'io') 8748 if obj.large_icon is not None: 8749 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 8750 if obj.lease is not None: 8751 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 8752 if obj.memory is not None: 8753 Writer.write_integer(writer, 'memory', obj.memory) 8754 if obj.memory_policy is not None: 8755 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 8756 if obj.migration is not None: 8757 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 8758 if obj.migration_downtime is not None: 8759 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 8760 if obj.multi_queues_enabled is not None: 8761 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 8762 if obj.name is not None: 8763 Writer.write_string(writer, 'name', obj.name) 8764 if obj.next_run_configuration_exists is not None: 8765 Writer.write_boolean(writer, 'next_run_configuration_exists', obj.next_run_configuration_exists) 8766 if obj.numa_tune_mode is not None: 8767 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 8768 if obj.origin is not None: 8769 Writer.write_string(writer, 'origin', obj.origin) 8770 if obj.os is not None: 8771 OperatingSystemWriter.write_one(obj.os, writer, 'os') 8772 if obj.payloads is not None: 8773 PayloadWriter.write_many(obj.payloads, writer, 'payload', 'payloads') 8774 if obj.persist_memorystate is not None: 8775 Writer.write_boolean(writer, 'persist_memorystate', obj.persist_memorystate) 8776 if obj.placement_policy is not None: 8777 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 8778 if obj.rng_device is not None: 8779 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 8780 if obj.run_once is not None: 8781 Writer.write_boolean(writer, 'run_once', obj.run_once) 8782 if obj.serial_number is not None: 8783 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 8784 if obj.small_icon is not None: 8785 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 8786 if obj.snapshot_status is not None: 8787 Writer.write_string(writer, 'snapshot_status', obj.snapshot_status.value) 8788 if obj.snapshot_type is not None: 8789 Writer.write_string(writer, 'snapshot_type', obj.snapshot_type.value) 8790 if obj.soundcard_enabled is not None: 8791 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 8792 if obj.sso is not None: 8793 SsoWriter.write_one(obj.sso, writer, 'sso') 8794 if obj.start_paused is not None: 8795 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 8796 if obj.start_time is not None: 8797 Writer.write_date(writer, 'start_time', obj.start_time) 8798 if obj.stateless is not None: 8799 Writer.write_boolean(writer, 'stateless', obj.stateless) 8800 if obj.status is not None: 8801 Writer.write_string(writer, 'status', obj.status.value) 8802 if obj.status_detail is not None: 8803 Writer.write_string(writer, 'status_detail', obj.status_detail) 8804 if obj.stop_reason is not None: 8805 Writer.write_string(writer, 'stop_reason', obj.stop_reason) 8806 if obj.stop_time is not None: 8807 Writer.write_date(writer, 'stop_time', obj.stop_time) 8808 if obj.storage_error_resume_behaviour is not None: 8809 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 8810 if obj.time_zone is not None: 8811 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 8812 if obj.tpm_enabled is not None: 8813 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 8814 if obj.tunnel_migration is not None: 8815 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 8816 if obj.type is not None: 8817 Writer.write_string(writer, 'type', obj.type.value) 8818 if obj.usb is not None: 8819 UsbWriter.write_one(obj.usb, writer, 'usb') 8820 if obj.use_latest_template_version is not None: 8821 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 8822 if obj.virtio_scsi is not None: 8823 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 8824 if obj.virtio_scsi_multi_queues is not None: 8825 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 8826 if obj.virtio_scsi_multi_queues_enabled is not None: 8827 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 8828 if obj.affinity_labels is not None: 8829 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 8830 if obj.applications is not None: 8831 ApplicationWriter.write_many(obj.applications, writer, 'application', 'applications') 8832 if obj.cdroms is not None: 8833 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 8834 if obj.cluster is not None: 8835 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 8836 if obj.cpu_profile is not None: 8837 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 8838 if obj.disk_attachments is not None: 8839 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 8840 if obj.disks is not None: 8841 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 8842 if obj.dynamic_cpu is not None: 8843 DynamicCpuWriter.write_one(obj.dynamic_cpu, writer, 'dynamic_cpu') 8844 if obj.external_host_provider is not None: 8845 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 8846 if obj.floppies is not None: 8847 FloppyWriter.write_many(obj.floppies, writer, 'floppy', 'floppies') 8848 if obj.graphics_consoles is not None: 8849 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 8850 if obj.host is not None: 8851 HostWriter.write_one(obj.host, writer, 'host') 8852 if obj.host_devices is not None: 8853 HostDeviceWriter.write_many(obj.host_devices, writer, 'host_device', 'host_devices') 8854 if obj.instance_type is not None: 8855 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 8856 if obj.katello_errata is not None: 8857 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 8858 if obj.mediated_devices is not None: 8859 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 8860 if obj.nics is not None: 8861 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 8862 if obj.numa_nodes is not None: 8863 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 8864 if obj.original_template is not None: 8865 TemplateWriter.write_one(obj.original_template, writer, 'original_template') 8866 if obj.permissions is not None: 8867 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 8868 if obj.quota is not None: 8869 QuotaWriter.write_one(obj.quota, writer, 'quota') 8870 if obj.reported_devices is not None: 8871 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 8872 if obj.sessions is not None: 8873 SessionWriter.write_many(obj.sessions, writer, 'session', 'sessions') 8874 if obj.snapshots is not None: 8875 SnapshotWriter.write_many(obj.snapshots, writer, 'snapshot', 'snapshots') 8876 if obj.statistics is not None: 8877 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 8878 if obj.storage_domain is not None: 8879 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 8880 if obj.tags is not None: 8881 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 8882 if obj.template is not None: 8883 TemplateWriter.write_one(obj.template, writer, 'template') 8884 if obj.vm is not None: 8885 VmWriter.write_one(obj.vm, writer, 'vm') 8886 if obj.vm_pool is not None: 8887 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 8888 if obj.watchdogs is not None: 8889 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 8890 writer.write_end() 8891 8892 @staticmethod 8893 def write_many(objs, writer, singular=None, plural=None): 8894 if singular is None: 8895 singular = 'snapshot' 8896 if plural is None: 8897 plural = 'snapshots' 8898 writer.write_start(plural) 8899 if isinstance(objs, List): 8900 href = objs.href 8901 if href is not None: 8902 writer.write_attribute('href', href) 8903 for obj in objs: 8904 SnapshotWriter.write_one(obj, writer, singular) 8905 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8690 @staticmethod 8691 def write_one(obj, writer, singular=None): 8692 if singular is None: 8693 singular = 'snapshot' 8694 writer.write_start(singular) 8695 href = obj.href 8696 if href is not None: 8697 writer.write_attribute('href', href) 8698 if obj.id is not None: 8699 writer.write_attribute('id', obj.id) 8700 if obj.auto_pinning_policy is not None: 8701 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 8702 if obj.bios is not None: 8703 BiosWriter.write_one(obj.bios, writer, 'bios') 8704 if obj.comment is not None: 8705 Writer.write_string(writer, 'comment', obj.comment) 8706 if obj.console is not None: 8707 ConsoleWriter.write_one(obj.console, writer, 'console') 8708 if obj.cpu is not None: 8709 CpuWriter.write_one(obj.cpu, writer, 'cpu') 8710 if obj.cpu_pinning_policy is not None: 8711 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 8712 if obj.cpu_shares is not None: 8713 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 8714 if obj.creation_time is not None: 8715 Writer.write_date(writer, 'creation_time', obj.creation_time) 8716 if obj.custom_compatibility_version is not None: 8717 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 8718 if obj.custom_cpu_model is not None: 8719 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 8720 if obj.custom_emulated_machine is not None: 8721 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 8722 if obj.custom_properties is not None: 8723 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 8724 if obj.date is not None: 8725 Writer.write_date(writer, 'date', obj.date) 8726 if obj.delete_protected is not None: 8727 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 8728 if obj.description is not None: 8729 Writer.write_string(writer, 'description', obj.description) 8730 if obj.display is not None: 8731 DisplayWriter.write_one(obj.display, writer, 'display') 8732 if obj.domain is not None: 8733 DomainWriter.write_one(obj.domain, writer, 'domain') 8734 if obj.fqdn is not None: 8735 Writer.write_string(writer, 'fqdn', obj.fqdn) 8736 if obj.guest_operating_system is not None: 8737 GuestOperatingSystemWriter.write_one(obj.guest_operating_system, writer, 'guest_operating_system') 8738 if obj.guest_time_zone is not None: 8739 TimeZoneWriter.write_one(obj.guest_time_zone, writer, 'guest_time_zone') 8740 if obj.has_illegal_images is not None: 8741 Writer.write_boolean(writer, 'has_illegal_images', obj.has_illegal_images) 8742 if obj.high_availability is not None: 8743 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 8744 if obj.initialization is not None: 8745 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 8746 if obj.io is not None: 8747 IoWriter.write_one(obj.io, writer, 'io') 8748 if obj.large_icon is not None: 8749 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 8750 if obj.lease is not None: 8751 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 8752 if obj.memory is not None: 8753 Writer.write_integer(writer, 'memory', obj.memory) 8754 if obj.memory_policy is not None: 8755 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 8756 if obj.migration is not None: 8757 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 8758 if obj.migration_downtime is not None: 8759 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 8760 if obj.multi_queues_enabled is not None: 8761 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 8762 if obj.name is not None: 8763 Writer.write_string(writer, 'name', obj.name) 8764 if obj.next_run_configuration_exists is not None: 8765 Writer.write_boolean(writer, 'next_run_configuration_exists', obj.next_run_configuration_exists) 8766 if obj.numa_tune_mode is not None: 8767 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 8768 if obj.origin is not None: 8769 Writer.write_string(writer, 'origin', obj.origin) 8770 if obj.os is not None: 8771 OperatingSystemWriter.write_one(obj.os, writer, 'os') 8772 if obj.payloads is not None: 8773 PayloadWriter.write_many(obj.payloads, writer, 'payload', 'payloads') 8774 if obj.persist_memorystate is not None: 8775 Writer.write_boolean(writer, 'persist_memorystate', obj.persist_memorystate) 8776 if obj.placement_policy is not None: 8777 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 8778 if obj.rng_device is not None: 8779 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 8780 if obj.run_once is not None: 8781 Writer.write_boolean(writer, 'run_once', obj.run_once) 8782 if obj.serial_number is not None: 8783 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 8784 if obj.small_icon is not None: 8785 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 8786 if obj.snapshot_status is not None: 8787 Writer.write_string(writer, 'snapshot_status', obj.snapshot_status.value) 8788 if obj.snapshot_type is not None: 8789 Writer.write_string(writer, 'snapshot_type', obj.snapshot_type.value) 8790 if obj.soundcard_enabled is not None: 8791 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 8792 if obj.sso is not None: 8793 SsoWriter.write_one(obj.sso, writer, 'sso') 8794 if obj.start_paused is not None: 8795 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 8796 if obj.start_time is not None: 8797 Writer.write_date(writer, 'start_time', obj.start_time) 8798 if obj.stateless is not None: 8799 Writer.write_boolean(writer, 'stateless', obj.stateless) 8800 if obj.status is not None: 8801 Writer.write_string(writer, 'status', obj.status.value) 8802 if obj.status_detail is not None: 8803 Writer.write_string(writer, 'status_detail', obj.status_detail) 8804 if obj.stop_reason is not None: 8805 Writer.write_string(writer, 'stop_reason', obj.stop_reason) 8806 if obj.stop_time is not None: 8807 Writer.write_date(writer, 'stop_time', obj.stop_time) 8808 if obj.storage_error_resume_behaviour is not None: 8809 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 8810 if obj.time_zone is not None: 8811 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 8812 if obj.tpm_enabled is not None: 8813 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 8814 if obj.tunnel_migration is not None: 8815 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 8816 if obj.type is not None: 8817 Writer.write_string(writer, 'type', obj.type.value) 8818 if obj.usb is not None: 8819 UsbWriter.write_one(obj.usb, writer, 'usb') 8820 if obj.use_latest_template_version is not None: 8821 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 8822 if obj.virtio_scsi is not None: 8823 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 8824 if obj.virtio_scsi_multi_queues is not None: 8825 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 8826 if obj.virtio_scsi_multi_queues_enabled is not None: 8827 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 8828 if obj.affinity_labels is not None: 8829 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 8830 if obj.applications is not None: 8831 ApplicationWriter.write_many(obj.applications, writer, 'application', 'applications') 8832 if obj.cdroms is not None: 8833 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 8834 if obj.cluster is not None: 8835 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 8836 if obj.cpu_profile is not None: 8837 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 8838 if obj.disk_attachments is not None: 8839 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 8840 if obj.disks is not None: 8841 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 8842 if obj.dynamic_cpu is not None: 8843 DynamicCpuWriter.write_one(obj.dynamic_cpu, writer, 'dynamic_cpu') 8844 if obj.external_host_provider is not None: 8845 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 8846 if obj.floppies is not None: 8847 FloppyWriter.write_many(obj.floppies, writer, 'floppy', 'floppies') 8848 if obj.graphics_consoles is not None: 8849 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 8850 if obj.host is not None: 8851 HostWriter.write_one(obj.host, writer, 'host') 8852 if obj.host_devices is not None: 8853 HostDeviceWriter.write_many(obj.host_devices, writer, 'host_device', 'host_devices') 8854 if obj.instance_type is not None: 8855 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 8856 if obj.katello_errata is not None: 8857 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 8858 if obj.mediated_devices is not None: 8859 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 8860 if obj.nics is not None: 8861 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 8862 if obj.numa_nodes is not None: 8863 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 8864 if obj.original_template is not None: 8865 TemplateWriter.write_one(obj.original_template, writer, 'original_template') 8866 if obj.permissions is not None: 8867 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 8868 if obj.quota is not None: 8869 QuotaWriter.write_one(obj.quota, writer, 'quota') 8870 if obj.reported_devices is not None: 8871 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 8872 if obj.sessions is not None: 8873 SessionWriter.write_many(obj.sessions, writer, 'session', 'sessions') 8874 if obj.snapshots is not None: 8875 SnapshotWriter.write_many(obj.snapshots, writer, 'snapshot', 'snapshots') 8876 if obj.statistics is not None: 8877 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 8878 if obj.storage_domain is not None: 8879 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 8880 if obj.tags is not None: 8881 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 8882 if obj.template is not None: 8883 TemplateWriter.write_one(obj.template, writer, 'template') 8884 if obj.vm is not None: 8885 VmWriter.write_one(obj.vm, writer, 'vm') 8886 if obj.vm_pool is not None: 8887 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 8888 if obj.watchdogs is not None: 8889 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 8890 writer.write_end()
8892 @staticmethod 8893 def write_many(objs, writer, singular=None, plural=None): 8894 if singular is None: 8895 singular = 'snapshot' 8896 if plural is None: 8897 plural = 'snapshots' 8898 writer.write_start(plural) 8899 if isinstance(objs, List): 8900 href = objs.href 8901 if href is not None: 8902 writer.write_attribute('href', href) 8903 for obj in objs: 8904 SnapshotWriter.write_one(obj, writer, singular) 8905 writer.write_end()
8908class SpecialObjectsWriter(Writer): 8909 8910 def __init__(self): 8911 super(SpecialObjectsWriter, self).__init__() 8912 8913 @staticmethod 8914 def write_one(obj, writer, singular=None): 8915 if singular is None: 8916 singular = 'special_objects' 8917 writer.write_start(singular) 8918 href = obj.href 8919 if href is not None: 8920 writer.write_attribute('href', href) 8921 if obj.blank_template is not None: 8922 TemplateWriter.write_one(obj.blank_template, writer, 'blank_template') 8923 if obj.root_tag is not None: 8924 TagWriter.write_one(obj.root_tag, writer, 'root_tag') 8925 writer.write_end() 8926 8927 @staticmethod 8928 def write_many(objs, writer, singular=None, plural=None): 8929 if singular is None: 8930 singular = 'special_objects' 8931 if plural is None: 8932 plural = 'special_objectss' 8933 writer.write_start(plural) 8934 if isinstance(objs, List): 8935 href = objs.href 8936 if href is not None: 8937 writer.write_attribute('href', href) 8938 for obj in objs: 8939 SpecialObjectsWriter.write_one(obj, writer, singular) 8940 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8913 @staticmethod 8914 def write_one(obj, writer, singular=None): 8915 if singular is None: 8916 singular = 'special_objects' 8917 writer.write_start(singular) 8918 href = obj.href 8919 if href is not None: 8920 writer.write_attribute('href', href) 8921 if obj.blank_template is not None: 8922 TemplateWriter.write_one(obj.blank_template, writer, 'blank_template') 8923 if obj.root_tag is not None: 8924 TagWriter.write_one(obj.root_tag, writer, 'root_tag') 8925 writer.write_end()
8927 @staticmethod 8928 def write_many(objs, writer, singular=None, plural=None): 8929 if singular is None: 8930 singular = 'special_objects' 8931 if plural is None: 8932 plural = 'special_objectss' 8933 writer.write_start(plural) 8934 if isinstance(objs, List): 8935 href = objs.href 8936 if href is not None: 8937 writer.write_attribute('href', href) 8938 for obj in objs: 8939 SpecialObjectsWriter.write_one(obj, writer, singular) 8940 writer.write_end()
8943class SpmWriter(Writer): 8944 8945 def __init__(self): 8946 super(SpmWriter, self).__init__() 8947 8948 @staticmethod 8949 def write_one(obj, writer, singular=None): 8950 if singular is None: 8951 singular = 'spm' 8952 writer.write_start(singular) 8953 href = obj.href 8954 if href is not None: 8955 writer.write_attribute('href', href) 8956 if obj.priority is not None: 8957 Writer.write_integer(writer, 'priority', obj.priority) 8958 if obj.status is not None: 8959 Writer.write_string(writer, 'status', obj.status.value) 8960 writer.write_end() 8961 8962 @staticmethod 8963 def write_many(objs, writer, singular=None, plural=None): 8964 if singular is None: 8965 singular = 'spm' 8966 if plural is None: 8967 plural = 'spms' 8968 writer.write_start(plural) 8969 if isinstance(objs, List): 8970 href = objs.href 8971 if href is not None: 8972 writer.write_attribute('href', href) 8973 for obj in objs: 8974 SpmWriter.write_one(obj, writer, singular) 8975 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8948 @staticmethod 8949 def write_one(obj, writer, singular=None): 8950 if singular is None: 8951 singular = 'spm' 8952 writer.write_start(singular) 8953 href = obj.href 8954 if href is not None: 8955 writer.write_attribute('href', href) 8956 if obj.priority is not None: 8957 Writer.write_integer(writer, 'priority', obj.priority) 8958 if obj.status is not None: 8959 Writer.write_string(writer, 'status', obj.status.value) 8960 writer.write_end()
8962 @staticmethod 8963 def write_many(objs, writer, singular=None, plural=None): 8964 if singular is None: 8965 singular = 'spm' 8966 if plural is None: 8967 plural = 'spms' 8968 writer.write_start(plural) 8969 if isinstance(objs, List): 8970 href = objs.href 8971 if href is not None: 8972 writer.write_attribute('href', href) 8973 for obj in objs: 8974 SpmWriter.write_one(obj, writer, singular) 8975 writer.write_end()
8978class SshWriter(Writer): 8979 8980 def __init__(self): 8981 super(SshWriter, self).__init__() 8982 8983 @staticmethod 8984 def write_one(obj, writer, singular=None): 8985 if singular is None: 8986 singular = 'ssh' 8987 writer.write_start(singular) 8988 href = obj.href 8989 if href is not None: 8990 writer.write_attribute('href', href) 8991 if obj.id is not None: 8992 writer.write_attribute('id', obj.id) 8993 if obj.authentication_method is not None: 8994 Writer.write_string(writer, 'authentication_method', obj.authentication_method.value) 8995 if obj.comment is not None: 8996 Writer.write_string(writer, 'comment', obj.comment) 8997 if obj.description is not None: 8998 Writer.write_string(writer, 'description', obj.description) 8999 if obj.fingerprint is not None: 9000 Writer.write_string(writer, 'fingerprint', obj.fingerprint) 9001 if obj.name is not None: 9002 Writer.write_string(writer, 'name', obj.name) 9003 if obj.port is not None: 9004 Writer.write_integer(writer, 'port', obj.port) 9005 if obj.public_key is not None: 9006 Writer.write_string(writer, 'public_key', obj.public_key) 9007 if obj.user is not None: 9008 UserWriter.write_one(obj.user, writer, 'user') 9009 writer.write_end() 9010 9011 @staticmethod 9012 def write_many(objs, writer, singular=None, plural=None): 9013 if singular is None: 9014 singular = 'ssh' 9015 if plural is None: 9016 plural = 'sshs' 9017 writer.write_start(plural) 9018 if isinstance(objs, List): 9019 href = objs.href 9020 if href is not None: 9021 writer.write_attribute('href', href) 9022 for obj in objs: 9023 SshWriter.write_one(obj, writer, singular) 9024 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
8983 @staticmethod 8984 def write_one(obj, writer, singular=None): 8985 if singular is None: 8986 singular = 'ssh' 8987 writer.write_start(singular) 8988 href = obj.href 8989 if href is not None: 8990 writer.write_attribute('href', href) 8991 if obj.id is not None: 8992 writer.write_attribute('id', obj.id) 8993 if obj.authentication_method is not None: 8994 Writer.write_string(writer, 'authentication_method', obj.authentication_method.value) 8995 if obj.comment is not None: 8996 Writer.write_string(writer, 'comment', obj.comment) 8997 if obj.description is not None: 8998 Writer.write_string(writer, 'description', obj.description) 8999 if obj.fingerprint is not None: 9000 Writer.write_string(writer, 'fingerprint', obj.fingerprint) 9001 if obj.name is not None: 9002 Writer.write_string(writer, 'name', obj.name) 9003 if obj.port is not None: 9004 Writer.write_integer(writer, 'port', obj.port) 9005 if obj.public_key is not None: 9006 Writer.write_string(writer, 'public_key', obj.public_key) 9007 if obj.user is not None: 9008 UserWriter.write_one(obj.user, writer, 'user') 9009 writer.write_end()
9011 @staticmethod 9012 def write_many(objs, writer, singular=None, plural=None): 9013 if singular is None: 9014 singular = 'ssh' 9015 if plural is None: 9016 plural = 'sshs' 9017 writer.write_start(plural) 9018 if isinstance(objs, List): 9019 href = objs.href 9020 if href is not None: 9021 writer.write_attribute('href', href) 9022 for obj in objs: 9023 SshWriter.write_one(obj, writer, singular) 9024 writer.write_end()
9027class SshPublicKeyWriter(Writer): 9028 9029 def __init__(self): 9030 super(SshPublicKeyWriter, self).__init__() 9031 9032 @staticmethod 9033 def write_one(obj, writer, singular=None): 9034 if singular is None: 9035 singular = 'ssh_public_key' 9036 writer.write_start(singular) 9037 href = obj.href 9038 if href is not None: 9039 writer.write_attribute('href', href) 9040 if obj.id is not None: 9041 writer.write_attribute('id', obj.id) 9042 if obj.comment is not None: 9043 Writer.write_string(writer, 'comment', obj.comment) 9044 if obj.content is not None: 9045 Writer.write_string(writer, 'content', obj.content) 9046 if obj.description is not None: 9047 Writer.write_string(writer, 'description', obj.description) 9048 if obj.name is not None: 9049 Writer.write_string(writer, 'name', obj.name) 9050 if obj.user is not None: 9051 UserWriter.write_one(obj.user, writer, 'user') 9052 writer.write_end() 9053 9054 @staticmethod 9055 def write_many(objs, writer, singular=None, plural=None): 9056 if singular is None: 9057 singular = 'ssh_public_key' 9058 if plural is None: 9059 plural = 'ssh_public_keys' 9060 writer.write_start(plural) 9061 if isinstance(objs, List): 9062 href = objs.href 9063 if href is not None: 9064 writer.write_attribute('href', href) 9065 for obj in objs: 9066 SshPublicKeyWriter.write_one(obj, writer, singular) 9067 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9032 @staticmethod 9033 def write_one(obj, writer, singular=None): 9034 if singular is None: 9035 singular = 'ssh_public_key' 9036 writer.write_start(singular) 9037 href = obj.href 9038 if href is not None: 9039 writer.write_attribute('href', href) 9040 if obj.id is not None: 9041 writer.write_attribute('id', obj.id) 9042 if obj.comment is not None: 9043 Writer.write_string(writer, 'comment', obj.comment) 9044 if obj.content is not None: 9045 Writer.write_string(writer, 'content', obj.content) 9046 if obj.description is not None: 9047 Writer.write_string(writer, 'description', obj.description) 9048 if obj.name is not None: 9049 Writer.write_string(writer, 'name', obj.name) 9050 if obj.user is not None: 9051 UserWriter.write_one(obj.user, writer, 'user') 9052 writer.write_end()
9054 @staticmethod 9055 def write_many(objs, writer, singular=None, plural=None): 9056 if singular is None: 9057 singular = 'ssh_public_key' 9058 if plural is None: 9059 plural = 'ssh_public_keys' 9060 writer.write_start(plural) 9061 if isinstance(objs, List): 9062 href = objs.href 9063 if href is not None: 9064 writer.write_attribute('href', href) 9065 for obj in objs: 9066 SshPublicKeyWriter.write_one(obj, writer, singular) 9067 writer.write_end()
9070class SsoWriter(Writer): 9071 9072 def __init__(self): 9073 super(SsoWriter, self).__init__() 9074 9075 @staticmethod 9076 def write_one(obj, writer, singular=None): 9077 if singular is None: 9078 singular = 'sso' 9079 writer.write_start(singular) 9080 href = obj.href 9081 if href is not None: 9082 writer.write_attribute('href', href) 9083 if obj.methods is not None: 9084 MethodWriter.write_many(obj.methods, writer, 'method', 'methods') 9085 writer.write_end() 9086 9087 @staticmethod 9088 def write_many(objs, writer, singular=None, plural=None): 9089 if singular is None: 9090 singular = 'sso' 9091 if plural is None: 9092 plural = 'ssos' 9093 writer.write_start(plural) 9094 if isinstance(objs, List): 9095 href = objs.href 9096 if href is not None: 9097 writer.write_attribute('href', href) 9098 for obj in objs: 9099 SsoWriter.write_one(obj, writer, singular) 9100 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9075 @staticmethod 9076 def write_one(obj, writer, singular=None): 9077 if singular is None: 9078 singular = 'sso' 9079 writer.write_start(singular) 9080 href = obj.href 9081 if href is not None: 9082 writer.write_attribute('href', href) 9083 if obj.methods is not None: 9084 MethodWriter.write_many(obj.methods, writer, 'method', 'methods') 9085 writer.write_end()
9087 @staticmethod 9088 def write_many(objs, writer, singular=None, plural=None): 9089 if singular is None: 9090 singular = 'sso' 9091 if plural is None: 9092 plural = 'ssos' 9093 writer.write_start(plural) 9094 if isinstance(objs, List): 9095 href = objs.href 9096 if href is not None: 9097 writer.write_attribute('href', href) 9098 for obj in objs: 9099 SsoWriter.write_one(obj, writer, singular) 9100 writer.write_end()
9103class StatisticWriter(Writer): 9104 9105 def __init__(self): 9106 super(StatisticWriter, self).__init__() 9107 9108 @staticmethod 9109 def write_one(obj, writer, singular=None): 9110 if singular is None: 9111 singular = 'statistic' 9112 writer.write_start(singular) 9113 href = obj.href 9114 if href is not None: 9115 writer.write_attribute('href', href) 9116 if obj.id is not None: 9117 writer.write_attribute('id', obj.id) 9118 if obj.comment is not None: 9119 Writer.write_string(writer, 'comment', obj.comment) 9120 if obj.description is not None: 9121 Writer.write_string(writer, 'description', obj.description) 9122 if obj.kind is not None: 9123 Writer.write_string(writer, 'kind', obj.kind.value) 9124 if obj.name is not None: 9125 Writer.write_string(writer, 'name', obj.name) 9126 if obj.type is not None: 9127 Writer.write_string(writer, 'type', obj.type.value) 9128 if obj.unit is not None: 9129 Writer.write_string(writer, 'unit', obj.unit.value) 9130 if obj.values is not None: 9131 ValueWriter.write_many(obj.values, writer, 'value', 'values') 9132 if obj.brick is not None: 9133 GlusterBrickWriter.write_one(obj.brick, writer, 'brick') 9134 if obj.disk is not None: 9135 DiskWriter.write_one(obj.disk, writer, 'disk') 9136 if obj.gluster_volume is not None: 9137 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 9138 if obj.host is not None: 9139 HostWriter.write_one(obj.host, writer, 'host') 9140 if obj.host_nic is not None: 9141 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 9142 if obj.host_numa_node is not None: 9143 NumaNodeWriter.write_one(obj.host_numa_node, writer, 'host_numa_node') 9144 if obj.nic is not None: 9145 NicWriter.write_one(obj.nic, writer, 'nic') 9146 if obj.step is not None: 9147 StepWriter.write_one(obj.step, writer, 'step') 9148 if obj.vm is not None: 9149 VmWriter.write_one(obj.vm, writer, 'vm') 9150 writer.write_end() 9151 9152 @staticmethod 9153 def write_many(objs, writer, singular=None, plural=None): 9154 if singular is None: 9155 singular = 'statistic' 9156 if plural is None: 9157 plural = 'statistics' 9158 writer.write_start(plural) 9159 if isinstance(objs, List): 9160 href = objs.href 9161 if href is not None: 9162 writer.write_attribute('href', href) 9163 for obj in objs: 9164 StatisticWriter.write_one(obj, writer, singular) 9165 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9108 @staticmethod 9109 def write_one(obj, writer, singular=None): 9110 if singular is None: 9111 singular = 'statistic' 9112 writer.write_start(singular) 9113 href = obj.href 9114 if href is not None: 9115 writer.write_attribute('href', href) 9116 if obj.id is not None: 9117 writer.write_attribute('id', obj.id) 9118 if obj.comment is not None: 9119 Writer.write_string(writer, 'comment', obj.comment) 9120 if obj.description is not None: 9121 Writer.write_string(writer, 'description', obj.description) 9122 if obj.kind is not None: 9123 Writer.write_string(writer, 'kind', obj.kind.value) 9124 if obj.name is not None: 9125 Writer.write_string(writer, 'name', obj.name) 9126 if obj.type is not None: 9127 Writer.write_string(writer, 'type', obj.type.value) 9128 if obj.unit is not None: 9129 Writer.write_string(writer, 'unit', obj.unit.value) 9130 if obj.values is not None: 9131 ValueWriter.write_many(obj.values, writer, 'value', 'values') 9132 if obj.brick is not None: 9133 GlusterBrickWriter.write_one(obj.brick, writer, 'brick') 9134 if obj.disk is not None: 9135 DiskWriter.write_one(obj.disk, writer, 'disk') 9136 if obj.gluster_volume is not None: 9137 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 9138 if obj.host is not None: 9139 HostWriter.write_one(obj.host, writer, 'host') 9140 if obj.host_nic is not None: 9141 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 9142 if obj.host_numa_node is not None: 9143 NumaNodeWriter.write_one(obj.host_numa_node, writer, 'host_numa_node') 9144 if obj.nic is not None: 9145 NicWriter.write_one(obj.nic, writer, 'nic') 9146 if obj.step is not None: 9147 StepWriter.write_one(obj.step, writer, 'step') 9148 if obj.vm is not None: 9149 VmWriter.write_one(obj.vm, writer, 'vm') 9150 writer.write_end()
9152 @staticmethod 9153 def write_many(objs, writer, singular=None, plural=None): 9154 if singular is None: 9155 singular = 'statistic' 9156 if plural is None: 9157 plural = 'statistics' 9158 writer.write_start(plural) 9159 if isinstance(objs, List): 9160 href = objs.href 9161 if href is not None: 9162 writer.write_attribute('href', href) 9163 for obj in objs: 9164 StatisticWriter.write_one(obj, writer, singular) 9165 writer.write_end()
9168class StepWriter(Writer): 9169 9170 def __init__(self): 9171 super(StepWriter, self).__init__() 9172 9173 @staticmethod 9174 def write_one(obj, writer, singular=None): 9175 if singular is None: 9176 singular = 'step' 9177 writer.write_start(singular) 9178 href = obj.href 9179 if href is not None: 9180 writer.write_attribute('href', href) 9181 if obj.id is not None: 9182 writer.write_attribute('id', obj.id) 9183 if obj.comment is not None: 9184 Writer.write_string(writer, 'comment', obj.comment) 9185 if obj.description is not None: 9186 Writer.write_string(writer, 'description', obj.description) 9187 if obj.end_time is not None: 9188 Writer.write_date(writer, 'end_time', obj.end_time) 9189 if obj.external is not None: 9190 Writer.write_boolean(writer, 'external', obj.external) 9191 if obj.external_type is not None: 9192 Writer.write_string(writer, 'external_type', obj.external_type.value) 9193 if obj.name is not None: 9194 Writer.write_string(writer, 'name', obj.name) 9195 if obj.number is not None: 9196 Writer.write_integer(writer, 'number', obj.number) 9197 if obj.progress is not None: 9198 Writer.write_integer(writer, 'progress', obj.progress) 9199 if obj.start_time is not None: 9200 Writer.write_date(writer, 'start_time', obj.start_time) 9201 if obj.status is not None: 9202 Writer.write_string(writer, 'status', obj.status.value) 9203 if obj.type is not None: 9204 Writer.write_string(writer, 'type', obj.type.value) 9205 if obj.execution_host is not None: 9206 HostWriter.write_one(obj.execution_host, writer, 'execution_host') 9207 if obj.job is not None: 9208 JobWriter.write_one(obj.job, writer, 'job') 9209 if obj.parent_step is not None: 9210 StepWriter.write_one(obj.parent_step, writer, 'parent_step') 9211 if obj.statistics is not None: 9212 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 9213 writer.write_end() 9214 9215 @staticmethod 9216 def write_many(objs, writer, singular=None, plural=None): 9217 if singular is None: 9218 singular = 'step' 9219 if plural is None: 9220 plural = 'steps' 9221 writer.write_start(plural) 9222 if isinstance(objs, List): 9223 href = objs.href 9224 if href is not None: 9225 writer.write_attribute('href', href) 9226 for obj in objs: 9227 StepWriter.write_one(obj, writer, singular) 9228 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9173 @staticmethod 9174 def write_one(obj, writer, singular=None): 9175 if singular is None: 9176 singular = 'step' 9177 writer.write_start(singular) 9178 href = obj.href 9179 if href is not None: 9180 writer.write_attribute('href', href) 9181 if obj.id is not None: 9182 writer.write_attribute('id', obj.id) 9183 if obj.comment is not None: 9184 Writer.write_string(writer, 'comment', obj.comment) 9185 if obj.description is not None: 9186 Writer.write_string(writer, 'description', obj.description) 9187 if obj.end_time is not None: 9188 Writer.write_date(writer, 'end_time', obj.end_time) 9189 if obj.external is not None: 9190 Writer.write_boolean(writer, 'external', obj.external) 9191 if obj.external_type is not None: 9192 Writer.write_string(writer, 'external_type', obj.external_type.value) 9193 if obj.name is not None: 9194 Writer.write_string(writer, 'name', obj.name) 9195 if obj.number is not None: 9196 Writer.write_integer(writer, 'number', obj.number) 9197 if obj.progress is not None: 9198 Writer.write_integer(writer, 'progress', obj.progress) 9199 if obj.start_time is not None: 9200 Writer.write_date(writer, 'start_time', obj.start_time) 9201 if obj.status is not None: 9202 Writer.write_string(writer, 'status', obj.status.value) 9203 if obj.type is not None: 9204 Writer.write_string(writer, 'type', obj.type.value) 9205 if obj.execution_host is not None: 9206 HostWriter.write_one(obj.execution_host, writer, 'execution_host') 9207 if obj.job is not None: 9208 JobWriter.write_one(obj.job, writer, 'job') 9209 if obj.parent_step is not None: 9210 StepWriter.write_one(obj.parent_step, writer, 'parent_step') 9211 if obj.statistics is not None: 9212 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 9213 writer.write_end()
9215 @staticmethod 9216 def write_many(objs, writer, singular=None, plural=None): 9217 if singular is None: 9218 singular = 'step' 9219 if plural is None: 9220 plural = 'steps' 9221 writer.write_start(plural) 9222 if isinstance(objs, List): 9223 href = objs.href 9224 if href is not None: 9225 writer.write_attribute('href', href) 9226 for obj in objs: 9227 StepWriter.write_one(obj, writer, singular) 9228 writer.write_end()
9231class StorageConnectionWriter(Writer): 9232 9233 def __init__(self): 9234 super(StorageConnectionWriter, self).__init__() 9235 9236 @staticmethod 9237 def write_one(obj, writer, singular=None): 9238 if singular is None: 9239 singular = 'storage_connection' 9240 writer.write_start(singular) 9241 href = obj.href 9242 if href is not None: 9243 writer.write_attribute('href', href) 9244 if obj.id is not None: 9245 writer.write_attribute('id', obj.id) 9246 if obj.address is not None: 9247 Writer.write_string(writer, 'address', obj.address) 9248 if obj.comment is not None: 9249 Writer.write_string(writer, 'comment', obj.comment) 9250 if obj.description is not None: 9251 Writer.write_string(writer, 'description', obj.description) 9252 if obj.mount_options is not None: 9253 Writer.write_string(writer, 'mount_options', obj.mount_options) 9254 if obj.name is not None: 9255 Writer.write_string(writer, 'name', obj.name) 9256 if obj.nfs_retrans is not None: 9257 Writer.write_integer(writer, 'nfs_retrans', obj.nfs_retrans) 9258 if obj.nfs_timeo is not None: 9259 Writer.write_integer(writer, 'nfs_timeo', obj.nfs_timeo) 9260 if obj.nfs_version is not None: 9261 Writer.write_string(writer, 'nfs_version', obj.nfs_version.value) 9262 if obj.password is not None: 9263 Writer.write_string(writer, 'password', obj.password) 9264 if obj.path is not None: 9265 Writer.write_string(writer, 'path', obj.path) 9266 if obj.port is not None: 9267 Writer.write_integer(writer, 'port', obj.port) 9268 if obj.portal is not None: 9269 Writer.write_string(writer, 'portal', obj.portal) 9270 if obj.target is not None: 9271 Writer.write_string(writer, 'target', obj.target) 9272 if obj.type is not None: 9273 Writer.write_string(writer, 'type', obj.type.value) 9274 if obj.username is not None: 9275 Writer.write_string(writer, 'username', obj.username) 9276 if obj.vfs_type is not None: 9277 Writer.write_string(writer, 'vfs_type', obj.vfs_type) 9278 if obj.gluster_volume is not None: 9279 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 9280 if obj.host is not None: 9281 HostWriter.write_one(obj.host, writer, 'host') 9282 writer.write_end() 9283 9284 @staticmethod 9285 def write_many(objs, writer, singular=None, plural=None): 9286 if singular is None: 9287 singular = 'storage_connection' 9288 if plural is None: 9289 plural = 'storage_connections' 9290 writer.write_start(plural) 9291 if isinstance(objs, List): 9292 href = objs.href 9293 if href is not None: 9294 writer.write_attribute('href', href) 9295 for obj in objs: 9296 StorageConnectionWriter.write_one(obj, writer, singular) 9297 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9236 @staticmethod 9237 def write_one(obj, writer, singular=None): 9238 if singular is None: 9239 singular = 'storage_connection' 9240 writer.write_start(singular) 9241 href = obj.href 9242 if href is not None: 9243 writer.write_attribute('href', href) 9244 if obj.id is not None: 9245 writer.write_attribute('id', obj.id) 9246 if obj.address is not None: 9247 Writer.write_string(writer, 'address', obj.address) 9248 if obj.comment is not None: 9249 Writer.write_string(writer, 'comment', obj.comment) 9250 if obj.description is not None: 9251 Writer.write_string(writer, 'description', obj.description) 9252 if obj.mount_options is not None: 9253 Writer.write_string(writer, 'mount_options', obj.mount_options) 9254 if obj.name is not None: 9255 Writer.write_string(writer, 'name', obj.name) 9256 if obj.nfs_retrans is not None: 9257 Writer.write_integer(writer, 'nfs_retrans', obj.nfs_retrans) 9258 if obj.nfs_timeo is not None: 9259 Writer.write_integer(writer, 'nfs_timeo', obj.nfs_timeo) 9260 if obj.nfs_version is not None: 9261 Writer.write_string(writer, 'nfs_version', obj.nfs_version.value) 9262 if obj.password is not None: 9263 Writer.write_string(writer, 'password', obj.password) 9264 if obj.path is not None: 9265 Writer.write_string(writer, 'path', obj.path) 9266 if obj.port is not None: 9267 Writer.write_integer(writer, 'port', obj.port) 9268 if obj.portal is not None: 9269 Writer.write_string(writer, 'portal', obj.portal) 9270 if obj.target is not None: 9271 Writer.write_string(writer, 'target', obj.target) 9272 if obj.type is not None: 9273 Writer.write_string(writer, 'type', obj.type.value) 9274 if obj.username is not None: 9275 Writer.write_string(writer, 'username', obj.username) 9276 if obj.vfs_type is not None: 9277 Writer.write_string(writer, 'vfs_type', obj.vfs_type) 9278 if obj.gluster_volume is not None: 9279 GlusterVolumeWriter.write_one(obj.gluster_volume, writer, 'gluster_volume') 9280 if obj.host is not None: 9281 HostWriter.write_one(obj.host, writer, 'host') 9282 writer.write_end()
9284 @staticmethod 9285 def write_many(objs, writer, singular=None, plural=None): 9286 if singular is None: 9287 singular = 'storage_connection' 9288 if plural is None: 9289 plural = 'storage_connections' 9290 writer.write_start(plural) 9291 if isinstance(objs, List): 9292 href = objs.href 9293 if href is not None: 9294 writer.write_attribute('href', href) 9295 for obj in objs: 9296 StorageConnectionWriter.write_one(obj, writer, singular) 9297 writer.write_end()
9300class StorageConnectionExtensionWriter(Writer): 9301 9302 def __init__(self): 9303 super(StorageConnectionExtensionWriter, self).__init__() 9304 9305 @staticmethod 9306 def write_one(obj, writer, singular=None): 9307 if singular is None: 9308 singular = 'storage_connection_extension' 9309 writer.write_start(singular) 9310 href = obj.href 9311 if href is not None: 9312 writer.write_attribute('href', href) 9313 if obj.id is not None: 9314 writer.write_attribute('id', obj.id) 9315 if obj.comment is not None: 9316 Writer.write_string(writer, 'comment', obj.comment) 9317 if obj.description is not None: 9318 Writer.write_string(writer, 'description', obj.description) 9319 if obj.name is not None: 9320 Writer.write_string(writer, 'name', obj.name) 9321 if obj.password is not None: 9322 Writer.write_string(writer, 'password', obj.password) 9323 if obj.target is not None: 9324 Writer.write_string(writer, 'target', obj.target) 9325 if obj.username is not None: 9326 Writer.write_string(writer, 'username', obj.username) 9327 if obj.host is not None: 9328 HostWriter.write_one(obj.host, writer, 'host') 9329 writer.write_end() 9330 9331 @staticmethod 9332 def write_many(objs, writer, singular=None, plural=None): 9333 if singular is None: 9334 singular = 'storage_connection_extension' 9335 if plural is None: 9336 plural = 'storage_connection_extensions' 9337 writer.write_start(plural) 9338 if isinstance(objs, List): 9339 href = objs.href 9340 if href is not None: 9341 writer.write_attribute('href', href) 9342 for obj in objs: 9343 StorageConnectionExtensionWriter.write_one(obj, writer, singular) 9344 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9305 @staticmethod 9306 def write_one(obj, writer, singular=None): 9307 if singular is None: 9308 singular = 'storage_connection_extension' 9309 writer.write_start(singular) 9310 href = obj.href 9311 if href is not None: 9312 writer.write_attribute('href', href) 9313 if obj.id is not None: 9314 writer.write_attribute('id', obj.id) 9315 if obj.comment is not None: 9316 Writer.write_string(writer, 'comment', obj.comment) 9317 if obj.description is not None: 9318 Writer.write_string(writer, 'description', obj.description) 9319 if obj.name is not None: 9320 Writer.write_string(writer, 'name', obj.name) 9321 if obj.password is not None: 9322 Writer.write_string(writer, 'password', obj.password) 9323 if obj.target is not None: 9324 Writer.write_string(writer, 'target', obj.target) 9325 if obj.username is not None: 9326 Writer.write_string(writer, 'username', obj.username) 9327 if obj.host is not None: 9328 HostWriter.write_one(obj.host, writer, 'host') 9329 writer.write_end()
9331 @staticmethod 9332 def write_many(objs, writer, singular=None, plural=None): 9333 if singular is None: 9334 singular = 'storage_connection_extension' 9335 if plural is None: 9336 plural = 'storage_connection_extensions' 9337 writer.write_start(plural) 9338 if isinstance(objs, List): 9339 href = objs.href 9340 if href is not None: 9341 writer.write_attribute('href', href) 9342 for obj in objs: 9343 StorageConnectionExtensionWriter.write_one(obj, writer, singular) 9344 writer.write_end()
9347class StorageDomainWriter(Writer): 9348 9349 def __init__(self): 9350 super(StorageDomainWriter, self).__init__() 9351 9352 @staticmethod 9353 def write_one(obj, writer, singular=None): 9354 if singular is None: 9355 singular = 'storage_domain' 9356 writer.write_start(singular) 9357 href = obj.href 9358 if href is not None: 9359 writer.write_attribute('href', href) 9360 if obj.id is not None: 9361 writer.write_attribute('id', obj.id) 9362 if obj.available is not None: 9363 Writer.write_integer(writer, 'available', obj.available) 9364 if obj.backup is not None: 9365 Writer.write_boolean(writer, 'backup', obj.backup) 9366 if obj.block_size is not None: 9367 Writer.write_integer(writer, 'block_size', obj.block_size) 9368 if obj.comment is not None: 9369 Writer.write_string(writer, 'comment', obj.comment) 9370 if obj.committed is not None: 9371 Writer.write_integer(writer, 'committed', obj.committed) 9372 if obj.critical_space_action_blocker is not None: 9373 Writer.write_integer(writer, 'critical_space_action_blocker', obj.critical_space_action_blocker) 9374 if obj.description is not None: 9375 Writer.write_string(writer, 'description', obj.description) 9376 if obj.discard_after_delete is not None: 9377 Writer.write_boolean(writer, 'discard_after_delete', obj.discard_after_delete) 9378 if obj.external_status is not None: 9379 Writer.write_string(writer, 'external_status', obj.external_status.value) 9380 if obj.import_ is not None: 9381 Writer.write_boolean(writer, 'import', obj.import_) 9382 if obj.master is not None: 9383 Writer.write_boolean(writer, 'master', obj.master) 9384 if obj.name is not None: 9385 Writer.write_string(writer, 'name', obj.name) 9386 if obj.status is not None: 9387 Writer.write_string(writer, 'status', obj.status.value) 9388 if obj.storage is not None: 9389 HostStorageWriter.write_one(obj.storage, writer, 'storage') 9390 if obj.storage_format is not None: 9391 Writer.write_string(writer, 'storage_format', obj.storage_format.value) 9392 if obj.supports_discard is not None: 9393 Writer.write_boolean(writer, 'supports_discard', obj.supports_discard) 9394 if obj.supports_discard_zeroes_data is not None: 9395 Writer.write_boolean(writer, 'supports_discard_zeroes_data', obj.supports_discard_zeroes_data) 9396 if obj.type is not None: 9397 Writer.write_string(writer, 'type', obj.type.value) 9398 if obj.used is not None: 9399 Writer.write_integer(writer, 'used', obj.used) 9400 if obj.warning_low_space_indicator is not None: 9401 Writer.write_integer(writer, 'warning_low_space_indicator', obj.warning_low_space_indicator) 9402 if obj.wipe_after_delete is not None: 9403 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 9404 if obj.data_center is not None: 9405 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 9406 if obj.data_centers is not None: 9407 DataCenterWriter.write_many(obj.data_centers, writer, 'data_center', 'data_centers') 9408 if obj.disk_profiles is not None: 9409 DiskProfileWriter.write_many(obj.disk_profiles, writer, 'disk_profile', 'disk_profiles') 9410 if obj.disk_snapshots is not None: 9411 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 9412 if obj.disks is not None: 9413 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 9414 if obj.files is not None: 9415 FileWriter.write_many(obj.files, writer, 'file', 'files') 9416 if obj.host is not None: 9417 HostWriter.write_one(obj.host, writer, 'host') 9418 if obj.images is not None: 9419 ImageWriter.write_many(obj.images, writer, 'image', 'images') 9420 if obj.permissions is not None: 9421 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 9422 if obj.storage_connections is not None: 9423 StorageConnectionWriter.write_many(obj.storage_connections, writer, 'storage_connection', 'storage_connections') 9424 if obj.templates is not None: 9425 TemplateWriter.write_many(obj.templates, writer, 'template', 'templates') 9426 if obj.vms is not None: 9427 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 9428 writer.write_end() 9429 9430 @staticmethod 9431 def write_many(objs, writer, singular=None, plural=None): 9432 if singular is None: 9433 singular = 'storage_domain' 9434 if plural is None: 9435 plural = 'storage_domains' 9436 writer.write_start(plural) 9437 if isinstance(objs, List): 9438 href = objs.href 9439 if href is not None: 9440 writer.write_attribute('href', href) 9441 for obj in objs: 9442 StorageDomainWriter.write_one(obj, writer, singular) 9443 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9352 @staticmethod 9353 def write_one(obj, writer, singular=None): 9354 if singular is None: 9355 singular = 'storage_domain' 9356 writer.write_start(singular) 9357 href = obj.href 9358 if href is not None: 9359 writer.write_attribute('href', href) 9360 if obj.id is not None: 9361 writer.write_attribute('id', obj.id) 9362 if obj.available is not None: 9363 Writer.write_integer(writer, 'available', obj.available) 9364 if obj.backup is not None: 9365 Writer.write_boolean(writer, 'backup', obj.backup) 9366 if obj.block_size is not None: 9367 Writer.write_integer(writer, 'block_size', obj.block_size) 9368 if obj.comment is not None: 9369 Writer.write_string(writer, 'comment', obj.comment) 9370 if obj.committed is not None: 9371 Writer.write_integer(writer, 'committed', obj.committed) 9372 if obj.critical_space_action_blocker is not None: 9373 Writer.write_integer(writer, 'critical_space_action_blocker', obj.critical_space_action_blocker) 9374 if obj.description is not None: 9375 Writer.write_string(writer, 'description', obj.description) 9376 if obj.discard_after_delete is not None: 9377 Writer.write_boolean(writer, 'discard_after_delete', obj.discard_after_delete) 9378 if obj.external_status is not None: 9379 Writer.write_string(writer, 'external_status', obj.external_status.value) 9380 if obj.import_ is not None: 9381 Writer.write_boolean(writer, 'import', obj.import_) 9382 if obj.master is not None: 9383 Writer.write_boolean(writer, 'master', obj.master) 9384 if obj.name is not None: 9385 Writer.write_string(writer, 'name', obj.name) 9386 if obj.status is not None: 9387 Writer.write_string(writer, 'status', obj.status.value) 9388 if obj.storage is not None: 9389 HostStorageWriter.write_one(obj.storage, writer, 'storage') 9390 if obj.storage_format is not None: 9391 Writer.write_string(writer, 'storage_format', obj.storage_format.value) 9392 if obj.supports_discard is not None: 9393 Writer.write_boolean(writer, 'supports_discard', obj.supports_discard) 9394 if obj.supports_discard_zeroes_data is not None: 9395 Writer.write_boolean(writer, 'supports_discard_zeroes_data', obj.supports_discard_zeroes_data) 9396 if obj.type is not None: 9397 Writer.write_string(writer, 'type', obj.type.value) 9398 if obj.used is not None: 9399 Writer.write_integer(writer, 'used', obj.used) 9400 if obj.warning_low_space_indicator is not None: 9401 Writer.write_integer(writer, 'warning_low_space_indicator', obj.warning_low_space_indicator) 9402 if obj.wipe_after_delete is not None: 9403 Writer.write_boolean(writer, 'wipe_after_delete', obj.wipe_after_delete) 9404 if obj.data_center is not None: 9405 DataCenterWriter.write_one(obj.data_center, writer, 'data_center') 9406 if obj.data_centers is not None: 9407 DataCenterWriter.write_many(obj.data_centers, writer, 'data_center', 'data_centers') 9408 if obj.disk_profiles is not None: 9409 DiskProfileWriter.write_many(obj.disk_profiles, writer, 'disk_profile', 'disk_profiles') 9410 if obj.disk_snapshots is not None: 9411 DiskSnapshotWriter.write_many(obj.disk_snapshots, writer, 'disk_snapshot', 'disk_snapshots') 9412 if obj.disks is not None: 9413 DiskWriter.write_many(obj.disks, writer, 'disk', 'disks') 9414 if obj.files is not None: 9415 FileWriter.write_many(obj.files, writer, 'file', 'files') 9416 if obj.host is not None: 9417 HostWriter.write_one(obj.host, writer, 'host') 9418 if obj.images is not None: 9419 ImageWriter.write_many(obj.images, writer, 'image', 'images') 9420 if obj.permissions is not None: 9421 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 9422 if obj.storage_connections is not None: 9423 StorageConnectionWriter.write_many(obj.storage_connections, writer, 'storage_connection', 'storage_connections') 9424 if obj.templates is not None: 9425 TemplateWriter.write_many(obj.templates, writer, 'template', 'templates') 9426 if obj.vms is not None: 9427 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 9428 writer.write_end()
9430 @staticmethod 9431 def write_many(objs, writer, singular=None, plural=None): 9432 if singular is None: 9433 singular = 'storage_domain' 9434 if plural is None: 9435 plural = 'storage_domains' 9436 writer.write_start(plural) 9437 if isinstance(objs, List): 9438 href = objs.href 9439 if href is not None: 9440 writer.write_attribute('href', href) 9441 for obj in objs: 9442 StorageDomainWriter.write_one(obj, writer, singular) 9443 writer.write_end()
9446class StorageDomainLeaseWriter(Writer): 9447 9448 def __init__(self): 9449 super(StorageDomainLeaseWriter, self).__init__() 9450 9451 @staticmethod 9452 def write_one(obj, writer, singular=None): 9453 if singular is None: 9454 singular = 'storage_domain_lease' 9455 writer.write_start(singular) 9456 href = obj.href 9457 if href is not None: 9458 writer.write_attribute('href', href) 9459 if obj.storage_domain is not None: 9460 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 9461 writer.write_end() 9462 9463 @staticmethod 9464 def write_many(objs, writer, singular=None, plural=None): 9465 if singular is None: 9466 singular = 'storage_domain_lease' 9467 if plural is None: 9468 plural = 'storage_domain_leases' 9469 writer.write_start(plural) 9470 if isinstance(objs, List): 9471 href = objs.href 9472 if href is not None: 9473 writer.write_attribute('href', href) 9474 for obj in objs: 9475 StorageDomainLeaseWriter.write_one(obj, writer, singular) 9476 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9451 @staticmethod 9452 def write_one(obj, writer, singular=None): 9453 if singular is None: 9454 singular = 'storage_domain_lease' 9455 writer.write_start(singular) 9456 href = obj.href 9457 if href is not None: 9458 writer.write_attribute('href', href) 9459 if obj.storage_domain is not None: 9460 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 9461 writer.write_end()
9463 @staticmethod 9464 def write_many(objs, writer, singular=None, plural=None): 9465 if singular is None: 9466 singular = 'storage_domain_lease' 9467 if plural is None: 9468 plural = 'storage_domain_leases' 9469 writer.write_start(plural) 9470 if isinstance(objs, List): 9471 href = objs.href 9472 if href is not None: 9473 writer.write_attribute('href', href) 9474 for obj in objs: 9475 StorageDomainLeaseWriter.write_one(obj, writer, singular) 9476 writer.write_end()
9479class SystemOptionWriter(Writer): 9480 9481 def __init__(self): 9482 super(SystemOptionWriter, self).__init__() 9483 9484 @staticmethod 9485 def write_one(obj, writer, singular=None): 9486 if singular is None: 9487 singular = 'system_option' 9488 writer.write_start(singular) 9489 href = obj.href 9490 if href is not None: 9491 writer.write_attribute('href', href) 9492 if obj.id is not None: 9493 writer.write_attribute('id', obj.id) 9494 if obj.comment is not None: 9495 Writer.write_string(writer, 'comment', obj.comment) 9496 if obj.description is not None: 9497 Writer.write_string(writer, 'description', obj.description) 9498 if obj.name is not None: 9499 Writer.write_string(writer, 'name', obj.name) 9500 if obj.values is not None: 9501 SystemOptionValueWriter.write_many(obj.values, writer, 'system_option_value', 'values') 9502 writer.write_end() 9503 9504 @staticmethod 9505 def write_many(objs, writer, singular=None, plural=None): 9506 if singular is None: 9507 singular = 'system_option' 9508 if plural is None: 9509 plural = 'system_options' 9510 writer.write_start(plural) 9511 if isinstance(objs, List): 9512 href = objs.href 9513 if href is not None: 9514 writer.write_attribute('href', href) 9515 for obj in objs: 9516 SystemOptionWriter.write_one(obj, writer, singular) 9517 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9484 @staticmethod 9485 def write_one(obj, writer, singular=None): 9486 if singular is None: 9487 singular = 'system_option' 9488 writer.write_start(singular) 9489 href = obj.href 9490 if href is not None: 9491 writer.write_attribute('href', href) 9492 if obj.id is not None: 9493 writer.write_attribute('id', obj.id) 9494 if obj.comment is not None: 9495 Writer.write_string(writer, 'comment', obj.comment) 9496 if obj.description is not None: 9497 Writer.write_string(writer, 'description', obj.description) 9498 if obj.name is not None: 9499 Writer.write_string(writer, 'name', obj.name) 9500 if obj.values is not None: 9501 SystemOptionValueWriter.write_many(obj.values, writer, 'system_option_value', 'values') 9502 writer.write_end()
9504 @staticmethod 9505 def write_many(objs, writer, singular=None, plural=None): 9506 if singular is None: 9507 singular = 'system_option' 9508 if plural is None: 9509 plural = 'system_options' 9510 writer.write_start(plural) 9511 if isinstance(objs, List): 9512 href = objs.href 9513 if href is not None: 9514 writer.write_attribute('href', href) 9515 for obj in objs: 9516 SystemOptionWriter.write_one(obj, writer, singular) 9517 writer.write_end()
9520class SystemOptionValueWriter(Writer): 9521 9522 def __init__(self): 9523 super(SystemOptionValueWriter, self).__init__() 9524 9525 @staticmethod 9526 def write_one(obj, writer, singular=None): 9527 if singular is None: 9528 singular = 'system_option_value' 9529 writer.write_start(singular) 9530 href = obj.href 9531 if href is not None: 9532 writer.write_attribute('href', href) 9533 if obj.value is not None: 9534 Writer.write_string(writer, 'value', obj.value) 9535 if obj.version is not None: 9536 Writer.write_string(writer, 'version', obj.version) 9537 writer.write_end() 9538 9539 @staticmethod 9540 def write_many(objs, writer, singular=None, plural=None): 9541 if singular is None: 9542 singular = 'system_option_value' 9543 if plural is None: 9544 plural = 'system_option_values' 9545 writer.write_start(plural) 9546 if isinstance(objs, List): 9547 href = objs.href 9548 if href is not None: 9549 writer.write_attribute('href', href) 9550 for obj in objs: 9551 SystemOptionValueWriter.write_one(obj, writer, singular) 9552 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9525 @staticmethod 9526 def write_one(obj, writer, singular=None): 9527 if singular is None: 9528 singular = 'system_option_value' 9529 writer.write_start(singular) 9530 href = obj.href 9531 if href is not None: 9532 writer.write_attribute('href', href) 9533 if obj.value is not None: 9534 Writer.write_string(writer, 'value', obj.value) 9535 if obj.version is not None: 9536 Writer.write_string(writer, 'version', obj.version) 9537 writer.write_end()
9539 @staticmethod 9540 def write_many(objs, writer, singular=None, plural=None): 9541 if singular is None: 9542 singular = 'system_option_value' 9543 if plural is None: 9544 plural = 'system_option_values' 9545 writer.write_start(plural) 9546 if isinstance(objs, List): 9547 href = objs.href 9548 if href is not None: 9549 writer.write_attribute('href', href) 9550 for obj in objs: 9551 SystemOptionValueWriter.write_one(obj, writer, singular) 9552 writer.write_end()
9555class TagWriter(Writer): 9556 9557 def __init__(self): 9558 super(TagWriter, self).__init__() 9559 9560 @staticmethod 9561 def write_one(obj, writer, singular=None): 9562 if singular is None: 9563 singular = 'tag' 9564 writer.write_start(singular) 9565 href = obj.href 9566 if href is not None: 9567 writer.write_attribute('href', href) 9568 if obj.id is not None: 9569 writer.write_attribute('id', obj.id) 9570 if obj.comment is not None: 9571 Writer.write_string(writer, 'comment', obj.comment) 9572 if obj.description is not None: 9573 Writer.write_string(writer, 'description', obj.description) 9574 if obj.name is not None: 9575 Writer.write_string(writer, 'name', obj.name) 9576 if obj.group is not None: 9577 GroupWriter.write_one(obj.group, writer, 'group') 9578 if obj.host is not None: 9579 HostWriter.write_one(obj.host, writer, 'host') 9580 if obj.parent is not None: 9581 TagWriter.write_one(obj.parent, writer, 'parent') 9582 if obj.template is not None: 9583 TemplateWriter.write_one(obj.template, writer, 'template') 9584 if obj.user is not None: 9585 UserWriter.write_one(obj.user, writer, 'user') 9586 if obj.vm is not None: 9587 VmWriter.write_one(obj.vm, writer, 'vm') 9588 writer.write_end() 9589 9590 @staticmethod 9591 def write_many(objs, writer, singular=None, plural=None): 9592 if singular is None: 9593 singular = 'tag' 9594 if plural is None: 9595 plural = 'tags' 9596 writer.write_start(plural) 9597 if isinstance(objs, List): 9598 href = objs.href 9599 if href is not None: 9600 writer.write_attribute('href', href) 9601 for obj in objs: 9602 TagWriter.write_one(obj, writer, singular) 9603 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9560 @staticmethod 9561 def write_one(obj, writer, singular=None): 9562 if singular is None: 9563 singular = 'tag' 9564 writer.write_start(singular) 9565 href = obj.href 9566 if href is not None: 9567 writer.write_attribute('href', href) 9568 if obj.id is not None: 9569 writer.write_attribute('id', obj.id) 9570 if obj.comment is not None: 9571 Writer.write_string(writer, 'comment', obj.comment) 9572 if obj.description is not None: 9573 Writer.write_string(writer, 'description', obj.description) 9574 if obj.name is not None: 9575 Writer.write_string(writer, 'name', obj.name) 9576 if obj.group is not None: 9577 GroupWriter.write_one(obj.group, writer, 'group') 9578 if obj.host is not None: 9579 HostWriter.write_one(obj.host, writer, 'host') 9580 if obj.parent is not None: 9581 TagWriter.write_one(obj.parent, writer, 'parent') 9582 if obj.template is not None: 9583 TemplateWriter.write_one(obj.template, writer, 'template') 9584 if obj.user is not None: 9585 UserWriter.write_one(obj.user, writer, 'user') 9586 if obj.vm is not None: 9587 VmWriter.write_one(obj.vm, writer, 'vm') 9588 writer.write_end()
9590 @staticmethod 9591 def write_many(objs, writer, singular=None, plural=None): 9592 if singular is None: 9593 singular = 'tag' 9594 if plural is None: 9595 plural = 'tags' 9596 writer.write_start(plural) 9597 if isinstance(objs, List): 9598 href = objs.href 9599 if href is not None: 9600 writer.write_attribute('href', href) 9601 for obj in objs: 9602 TagWriter.write_one(obj, writer, singular) 9603 writer.write_end()
9606class TemplateWriter(Writer): 9607 9608 def __init__(self): 9609 super(TemplateWriter, self).__init__() 9610 9611 @staticmethod 9612 def write_one(obj, writer, singular=None): 9613 if singular is None: 9614 singular = 'template' 9615 writer.write_start(singular) 9616 href = obj.href 9617 if href is not None: 9618 writer.write_attribute('href', href) 9619 if obj.id is not None: 9620 writer.write_attribute('id', obj.id) 9621 if obj.auto_pinning_policy is not None: 9622 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 9623 if obj.bios is not None: 9624 BiosWriter.write_one(obj.bios, writer, 'bios') 9625 if obj.comment is not None: 9626 Writer.write_string(writer, 'comment', obj.comment) 9627 if obj.console is not None: 9628 ConsoleWriter.write_one(obj.console, writer, 'console') 9629 if obj.cpu is not None: 9630 CpuWriter.write_one(obj.cpu, writer, 'cpu') 9631 if obj.cpu_pinning_policy is not None: 9632 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 9633 if obj.cpu_shares is not None: 9634 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 9635 if obj.creation_time is not None: 9636 Writer.write_date(writer, 'creation_time', obj.creation_time) 9637 if obj.custom_compatibility_version is not None: 9638 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 9639 if obj.custom_cpu_model is not None: 9640 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 9641 if obj.custom_emulated_machine is not None: 9642 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 9643 if obj.custom_properties is not None: 9644 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 9645 if obj.delete_protected is not None: 9646 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 9647 if obj.description is not None: 9648 Writer.write_string(writer, 'description', obj.description) 9649 if obj.display is not None: 9650 DisplayWriter.write_one(obj.display, writer, 'display') 9651 if obj.domain is not None: 9652 DomainWriter.write_one(obj.domain, writer, 'domain') 9653 if obj.high_availability is not None: 9654 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 9655 if obj.initialization is not None: 9656 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 9657 if obj.io is not None: 9658 IoWriter.write_one(obj.io, writer, 'io') 9659 if obj.large_icon is not None: 9660 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 9661 if obj.lease is not None: 9662 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 9663 if obj.memory is not None: 9664 Writer.write_integer(writer, 'memory', obj.memory) 9665 if obj.memory_policy is not None: 9666 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 9667 if obj.migration is not None: 9668 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 9669 if obj.migration_downtime is not None: 9670 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 9671 if obj.multi_queues_enabled is not None: 9672 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 9673 if obj.name is not None: 9674 Writer.write_string(writer, 'name', obj.name) 9675 if obj.origin is not None: 9676 Writer.write_string(writer, 'origin', obj.origin) 9677 if obj.os is not None: 9678 OperatingSystemWriter.write_one(obj.os, writer, 'os') 9679 if obj.placement_policy is not None: 9680 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 9681 if obj.rng_device is not None: 9682 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 9683 if obj.serial_number is not None: 9684 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 9685 if obj.small_icon is not None: 9686 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 9687 if obj.soundcard_enabled is not None: 9688 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 9689 if obj.sso is not None: 9690 SsoWriter.write_one(obj.sso, writer, 'sso') 9691 if obj.start_paused is not None: 9692 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 9693 if obj.stateless is not None: 9694 Writer.write_boolean(writer, 'stateless', obj.stateless) 9695 if obj.status is not None: 9696 Writer.write_string(writer, 'status', obj.status.value) 9697 if obj.storage_error_resume_behaviour is not None: 9698 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 9699 if obj.time_zone is not None: 9700 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 9701 if obj.tpm_enabled is not None: 9702 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 9703 if obj.tunnel_migration is not None: 9704 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 9705 if obj.type is not None: 9706 Writer.write_string(writer, 'type', obj.type.value) 9707 if obj.usb is not None: 9708 UsbWriter.write_one(obj.usb, writer, 'usb') 9709 if obj.version is not None: 9710 TemplateVersionWriter.write_one(obj.version, writer, 'version') 9711 if obj.virtio_scsi is not None: 9712 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 9713 if obj.virtio_scsi_multi_queues is not None: 9714 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 9715 if obj.virtio_scsi_multi_queues_enabled is not None: 9716 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 9717 if obj.vm is not None: 9718 VmWriter.write_one(obj.vm, writer, 'vm') 9719 if obj.cdroms is not None: 9720 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 9721 if obj.cluster is not None: 9722 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 9723 if obj.cpu_profile is not None: 9724 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 9725 if obj.disk_attachments is not None: 9726 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 9727 if obj.graphics_consoles is not None: 9728 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 9729 if obj.mediated_devices is not None: 9730 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 9731 if obj.nics is not None: 9732 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 9733 if obj.permissions is not None: 9734 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 9735 if obj.quota is not None: 9736 QuotaWriter.write_one(obj.quota, writer, 'quota') 9737 if obj.storage_domain is not None: 9738 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 9739 if obj.tags is not None: 9740 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 9741 if obj.watchdogs is not None: 9742 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 9743 writer.write_end() 9744 9745 @staticmethod 9746 def write_many(objs, writer, singular=None, plural=None): 9747 if singular is None: 9748 singular = 'template' 9749 if plural is None: 9750 plural = 'templates' 9751 writer.write_start(plural) 9752 if isinstance(objs, List): 9753 href = objs.href 9754 if href is not None: 9755 writer.write_attribute('href', href) 9756 for obj in objs: 9757 TemplateWriter.write_one(obj, writer, singular) 9758 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9611 @staticmethod 9612 def write_one(obj, writer, singular=None): 9613 if singular is None: 9614 singular = 'template' 9615 writer.write_start(singular) 9616 href = obj.href 9617 if href is not None: 9618 writer.write_attribute('href', href) 9619 if obj.id is not None: 9620 writer.write_attribute('id', obj.id) 9621 if obj.auto_pinning_policy is not None: 9622 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 9623 if obj.bios is not None: 9624 BiosWriter.write_one(obj.bios, writer, 'bios') 9625 if obj.comment is not None: 9626 Writer.write_string(writer, 'comment', obj.comment) 9627 if obj.console is not None: 9628 ConsoleWriter.write_one(obj.console, writer, 'console') 9629 if obj.cpu is not None: 9630 CpuWriter.write_one(obj.cpu, writer, 'cpu') 9631 if obj.cpu_pinning_policy is not None: 9632 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 9633 if obj.cpu_shares is not None: 9634 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 9635 if obj.creation_time is not None: 9636 Writer.write_date(writer, 'creation_time', obj.creation_time) 9637 if obj.custom_compatibility_version is not None: 9638 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 9639 if obj.custom_cpu_model is not None: 9640 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 9641 if obj.custom_emulated_machine is not None: 9642 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 9643 if obj.custom_properties is not None: 9644 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 9645 if obj.delete_protected is not None: 9646 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 9647 if obj.description is not None: 9648 Writer.write_string(writer, 'description', obj.description) 9649 if obj.display is not None: 9650 DisplayWriter.write_one(obj.display, writer, 'display') 9651 if obj.domain is not None: 9652 DomainWriter.write_one(obj.domain, writer, 'domain') 9653 if obj.high_availability is not None: 9654 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 9655 if obj.initialization is not None: 9656 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 9657 if obj.io is not None: 9658 IoWriter.write_one(obj.io, writer, 'io') 9659 if obj.large_icon is not None: 9660 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 9661 if obj.lease is not None: 9662 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 9663 if obj.memory is not None: 9664 Writer.write_integer(writer, 'memory', obj.memory) 9665 if obj.memory_policy is not None: 9666 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 9667 if obj.migration is not None: 9668 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 9669 if obj.migration_downtime is not None: 9670 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 9671 if obj.multi_queues_enabled is not None: 9672 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 9673 if obj.name is not None: 9674 Writer.write_string(writer, 'name', obj.name) 9675 if obj.origin is not None: 9676 Writer.write_string(writer, 'origin', obj.origin) 9677 if obj.os is not None: 9678 OperatingSystemWriter.write_one(obj.os, writer, 'os') 9679 if obj.placement_policy is not None: 9680 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 9681 if obj.rng_device is not None: 9682 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 9683 if obj.serial_number is not None: 9684 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 9685 if obj.small_icon is not None: 9686 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 9687 if obj.soundcard_enabled is not None: 9688 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 9689 if obj.sso is not None: 9690 SsoWriter.write_one(obj.sso, writer, 'sso') 9691 if obj.start_paused is not None: 9692 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 9693 if obj.stateless is not None: 9694 Writer.write_boolean(writer, 'stateless', obj.stateless) 9695 if obj.status is not None: 9696 Writer.write_string(writer, 'status', obj.status.value) 9697 if obj.storage_error_resume_behaviour is not None: 9698 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 9699 if obj.time_zone is not None: 9700 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 9701 if obj.tpm_enabled is not None: 9702 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 9703 if obj.tunnel_migration is not None: 9704 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 9705 if obj.type is not None: 9706 Writer.write_string(writer, 'type', obj.type.value) 9707 if obj.usb is not None: 9708 UsbWriter.write_one(obj.usb, writer, 'usb') 9709 if obj.version is not None: 9710 TemplateVersionWriter.write_one(obj.version, writer, 'version') 9711 if obj.virtio_scsi is not None: 9712 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 9713 if obj.virtio_scsi_multi_queues is not None: 9714 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 9715 if obj.virtio_scsi_multi_queues_enabled is not None: 9716 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 9717 if obj.vm is not None: 9718 VmWriter.write_one(obj.vm, writer, 'vm') 9719 if obj.cdroms is not None: 9720 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 9721 if obj.cluster is not None: 9722 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 9723 if obj.cpu_profile is not None: 9724 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 9725 if obj.disk_attachments is not None: 9726 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 9727 if obj.graphics_consoles is not None: 9728 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 9729 if obj.mediated_devices is not None: 9730 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 9731 if obj.nics is not None: 9732 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 9733 if obj.permissions is not None: 9734 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 9735 if obj.quota is not None: 9736 QuotaWriter.write_one(obj.quota, writer, 'quota') 9737 if obj.storage_domain is not None: 9738 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 9739 if obj.tags is not None: 9740 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 9741 if obj.watchdogs is not None: 9742 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 9743 writer.write_end()
9745 @staticmethod 9746 def write_many(objs, writer, singular=None, plural=None): 9747 if singular is None: 9748 singular = 'template' 9749 if plural is None: 9750 plural = 'templates' 9751 writer.write_start(plural) 9752 if isinstance(objs, List): 9753 href = objs.href 9754 if href is not None: 9755 writer.write_attribute('href', href) 9756 for obj in objs: 9757 TemplateWriter.write_one(obj, writer, singular) 9758 writer.write_end()
9761class TemplateVersionWriter(Writer): 9762 9763 def __init__(self): 9764 super(TemplateVersionWriter, self).__init__() 9765 9766 @staticmethod 9767 def write_one(obj, writer, singular=None): 9768 if singular is None: 9769 singular = 'template_version' 9770 writer.write_start(singular) 9771 href = obj.href 9772 if href is not None: 9773 writer.write_attribute('href', href) 9774 if obj.version_name is not None: 9775 Writer.write_string(writer, 'version_name', obj.version_name) 9776 if obj.version_number is not None: 9777 Writer.write_integer(writer, 'version_number', obj.version_number) 9778 if obj.base_template is not None: 9779 TemplateWriter.write_one(obj.base_template, writer, 'base_template') 9780 writer.write_end() 9781 9782 @staticmethod 9783 def write_many(objs, writer, singular=None, plural=None): 9784 if singular is None: 9785 singular = 'template_version' 9786 if plural is None: 9787 plural = 'template_versions' 9788 writer.write_start(plural) 9789 if isinstance(objs, List): 9790 href = objs.href 9791 if href is not None: 9792 writer.write_attribute('href', href) 9793 for obj in objs: 9794 TemplateVersionWriter.write_one(obj, writer, singular) 9795 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9766 @staticmethod 9767 def write_one(obj, writer, singular=None): 9768 if singular is None: 9769 singular = 'template_version' 9770 writer.write_start(singular) 9771 href = obj.href 9772 if href is not None: 9773 writer.write_attribute('href', href) 9774 if obj.version_name is not None: 9775 Writer.write_string(writer, 'version_name', obj.version_name) 9776 if obj.version_number is not None: 9777 Writer.write_integer(writer, 'version_number', obj.version_number) 9778 if obj.base_template is not None: 9779 TemplateWriter.write_one(obj.base_template, writer, 'base_template') 9780 writer.write_end()
9782 @staticmethod 9783 def write_many(objs, writer, singular=None, plural=None): 9784 if singular is None: 9785 singular = 'template_version' 9786 if plural is None: 9787 plural = 'template_versions' 9788 writer.write_start(plural) 9789 if isinstance(objs, List): 9790 href = objs.href 9791 if href is not None: 9792 writer.write_attribute('href', href) 9793 for obj in objs: 9794 TemplateVersionWriter.write_one(obj, writer, singular) 9795 writer.write_end()
9798class TicketWriter(Writer): 9799 9800 def __init__(self): 9801 super(TicketWriter, self).__init__() 9802 9803 @staticmethod 9804 def write_one(obj, writer, singular=None): 9805 if singular is None: 9806 singular = 'ticket' 9807 writer.write_start(singular) 9808 href = obj.href 9809 if href is not None: 9810 writer.write_attribute('href', href) 9811 if obj.expiry is not None: 9812 Writer.write_integer(writer, 'expiry', obj.expiry) 9813 if obj.value is not None: 9814 Writer.write_string(writer, 'value', obj.value) 9815 writer.write_end() 9816 9817 @staticmethod 9818 def write_many(objs, writer, singular=None, plural=None): 9819 if singular is None: 9820 singular = 'ticket' 9821 if plural is None: 9822 plural = 'tickets' 9823 writer.write_start(plural) 9824 if isinstance(objs, List): 9825 href = objs.href 9826 if href is not None: 9827 writer.write_attribute('href', href) 9828 for obj in objs: 9829 TicketWriter.write_one(obj, writer, singular) 9830 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9803 @staticmethod 9804 def write_one(obj, writer, singular=None): 9805 if singular is None: 9806 singular = 'ticket' 9807 writer.write_start(singular) 9808 href = obj.href 9809 if href is not None: 9810 writer.write_attribute('href', href) 9811 if obj.expiry is not None: 9812 Writer.write_integer(writer, 'expiry', obj.expiry) 9813 if obj.value is not None: 9814 Writer.write_string(writer, 'value', obj.value) 9815 writer.write_end()
9817 @staticmethod 9818 def write_many(objs, writer, singular=None, plural=None): 9819 if singular is None: 9820 singular = 'ticket' 9821 if plural is None: 9822 plural = 'tickets' 9823 writer.write_start(plural) 9824 if isinstance(objs, List): 9825 href = objs.href 9826 if href is not None: 9827 writer.write_attribute('href', href) 9828 for obj in objs: 9829 TicketWriter.write_one(obj, writer, singular) 9830 writer.write_end()
9833class TimeZoneWriter(Writer): 9834 9835 def __init__(self): 9836 super(TimeZoneWriter, self).__init__() 9837 9838 @staticmethod 9839 def write_one(obj, writer, singular=None): 9840 if singular is None: 9841 singular = 'time_zone' 9842 writer.write_start(singular) 9843 href = obj.href 9844 if href is not None: 9845 writer.write_attribute('href', href) 9846 if obj.name is not None: 9847 Writer.write_string(writer, 'name', obj.name) 9848 if obj.utc_offset is not None: 9849 Writer.write_string(writer, 'utc_offset', obj.utc_offset) 9850 writer.write_end() 9851 9852 @staticmethod 9853 def write_many(objs, writer, singular=None, plural=None): 9854 if singular is None: 9855 singular = 'time_zone' 9856 if plural is None: 9857 plural = 'time_zones' 9858 writer.write_start(plural) 9859 if isinstance(objs, List): 9860 href = objs.href 9861 if href is not None: 9862 writer.write_attribute('href', href) 9863 for obj in objs: 9864 TimeZoneWriter.write_one(obj, writer, singular) 9865 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9838 @staticmethod 9839 def write_one(obj, writer, singular=None): 9840 if singular is None: 9841 singular = 'time_zone' 9842 writer.write_start(singular) 9843 href = obj.href 9844 if href is not None: 9845 writer.write_attribute('href', href) 9846 if obj.name is not None: 9847 Writer.write_string(writer, 'name', obj.name) 9848 if obj.utc_offset is not None: 9849 Writer.write_string(writer, 'utc_offset', obj.utc_offset) 9850 writer.write_end()
9852 @staticmethod 9853 def write_many(objs, writer, singular=None, plural=None): 9854 if singular is None: 9855 singular = 'time_zone' 9856 if plural is None: 9857 plural = 'time_zones' 9858 writer.write_start(plural) 9859 if isinstance(objs, List): 9860 href = objs.href 9861 if href is not None: 9862 writer.write_attribute('href', href) 9863 for obj in objs: 9864 TimeZoneWriter.write_one(obj, writer, singular) 9865 writer.write_end()
9868class TransparentHugePagesWriter(Writer): 9869 9870 def __init__(self): 9871 super(TransparentHugePagesWriter, self).__init__() 9872 9873 @staticmethod 9874 def write_one(obj, writer, singular=None): 9875 if singular is None: 9876 singular = 'transparent_hugepages' 9877 writer.write_start(singular) 9878 href = obj.href 9879 if href is not None: 9880 writer.write_attribute('href', href) 9881 if obj.enabled is not None: 9882 Writer.write_boolean(writer, 'enabled', obj.enabled) 9883 writer.write_end() 9884 9885 @staticmethod 9886 def write_many(objs, writer, singular=None, plural=None): 9887 if singular is None: 9888 singular = 'transparent_hugepages' 9889 if plural is None: 9890 plural = 'transparent_huge_pagess' 9891 writer.write_start(plural) 9892 if isinstance(objs, List): 9893 href = objs.href 9894 if href is not None: 9895 writer.write_attribute('href', href) 9896 for obj in objs: 9897 TransparentHugePagesWriter.write_one(obj, writer, singular) 9898 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9873 @staticmethod 9874 def write_one(obj, writer, singular=None): 9875 if singular is None: 9876 singular = 'transparent_hugepages' 9877 writer.write_start(singular) 9878 href = obj.href 9879 if href is not None: 9880 writer.write_attribute('href', href) 9881 if obj.enabled is not None: 9882 Writer.write_boolean(writer, 'enabled', obj.enabled) 9883 writer.write_end()
9885 @staticmethod 9886 def write_many(objs, writer, singular=None, plural=None): 9887 if singular is None: 9888 singular = 'transparent_hugepages' 9889 if plural is None: 9890 plural = 'transparent_huge_pagess' 9891 writer.write_start(plural) 9892 if isinstance(objs, List): 9893 href = objs.href 9894 if href is not None: 9895 writer.write_attribute('href', href) 9896 for obj in objs: 9897 TransparentHugePagesWriter.write_one(obj, writer, singular) 9898 writer.write_end()
9901class UnmanagedNetworkWriter(Writer): 9902 9903 def __init__(self): 9904 super(UnmanagedNetworkWriter, self).__init__() 9905 9906 @staticmethod 9907 def write_one(obj, writer, singular=None): 9908 if singular is None: 9909 singular = 'unmanaged_network' 9910 writer.write_start(singular) 9911 href = obj.href 9912 if href is not None: 9913 writer.write_attribute('href', href) 9914 if obj.id is not None: 9915 writer.write_attribute('id', obj.id) 9916 if obj.comment is not None: 9917 Writer.write_string(writer, 'comment', obj.comment) 9918 if obj.description is not None: 9919 Writer.write_string(writer, 'description', obj.description) 9920 if obj.name is not None: 9921 Writer.write_string(writer, 'name', obj.name) 9922 if obj.host is not None: 9923 HostWriter.write_one(obj.host, writer, 'host') 9924 if obj.host_nic is not None: 9925 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 9926 writer.write_end() 9927 9928 @staticmethod 9929 def write_many(objs, writer, singular=None, plural=None): 9930 if singular is None: 9931 singular = 'unmanaged_network' 9932 if plural is None: 9933 plural = 'unmanaged_networks' 9934 writer.write_start(plural) 9935 if isinstance(objs, List): 9936 href = objs.href 9937 if href is not None: 9938 writer.write_attribute('href', href) 9939 for obj in objs: 9940 UnmanagedNetworkWriter.write_one(obj, writer, singular) 9941 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9906 @staticmethod 9907 def write_one(obj, writer, singular=None): 9908 if singular is None: 9909 singular = 'unmanaged_network' 9910 writer.write_start(singular) 9911 href = obj.href 9912 if href is not None: 9913 writer.write_attribute('href', href) 9914 if obj.id is not None: 9915 writer.write_attribute('id', obj.id) 9916 if obj.comment is not None: 9917 Writer.write_string(writer, 'comment', obj.comment) 9918 if obj.description is not None: 9919 Writer.write_string(writer, 'description', obj.description) 9920 if obj.name is not None: 9921 Writer.write_string(writer, 'name', obj.name) 9922 if obj.host is not None: 9923 HostWriter.write_one(obj.host, writer, 'host') 9924 if obj.host_nic is not None: 9925 HostNicWriter.write_one(obj.host_nic, writer, 'host_nic') 9926 writer.write_end()
9928 @staticmethod 9929 def write_many(objs, writer, singular=None, plural=None): 9930 if singular is None: 9931 singular = 'unmanaged_network' 9932 if plural is None: 9933 plural = 'unmanaged_networks' 9934 writer.write_start(plural) 9935 if isinstance(objs, List): 9936 href = objs.href 9937 if href is not None: 9938 writer.write_attribute('href', href) 9939 for obj in objs: 9940 UnmanagedNetworkWriter.write_one(obj, writer, singular) 9941 writer.write_end()
9944class UsbWriter(Writer): 9945 9946 def __init__(self): 9947 super(UsbWriter, self).__init__() 9948 9949 @staticmethod 9950 def write_one(obj, writer, singular=None): 9951 if singular is None: 9952 singular = 'usb' 9953 writer.write_start(singular) 9954 href = obj.href 9955 if href is not None: 9956 writer.write_attribute('href', href) 9957 if obj.enabled is not None: 9958 Writer.write_boolean(writer, 'enabled', obj.enabled) 9959 if obj.type is not None: 9960 Writer.write_string(writer, 'type', obj.type.value) 9961 writer.write_end() 9962 9963 @staticmethod 9964 def write_many(objs, writer, singular=None, plural=None): 9965 if singular is None: 9966 singular = 'usb' 9967 if plural is None: 9968 plural = 'usbs' 9969 writer.write_start(plural) 9970 if isinstance(objs, List): 9971 href = objs.href 9972 if href is not None: 9973 writer.write_attribute('href', href) 9974 for obj in objs: 9975 UsbWriter.write_one(obj, writer, singular) 9976 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9949 @staticmethod 9950 def write_one(obj, writer, singular=None): 9951 if singular is None: 9952 singular = 'usb' 9953 writer.write_start(singular) 9954 href = obj.href 9955 if href is not None: 9956 writer.write_attribute('href', href) 9957 if obj.enabled is not None: 9958 Writer.write_boolean(writer, 'enabled', obj.enabled) 9959 if obj.type is not None: 9960 Writer.write_string(writer, 'type', obj.type.value) 9961 writer.write_end()
9963 @staticmethod 9964 def write_many(objs, writer, singular=None, plural=None): 9965 if singular is None: 9966 singular = 'usb' 9967 if plural is None: 9968 plural = 'usbs' 9969 writer.write_start(plural) 9970 if isinstance(objs, List): 9971 href = objs.href 9972 if href is not None: 9973 writer.write_attribute('href', href) 9974 for obj in objs: 9975 UsbWriter.write_one(obj, writer, singular) 9976 writer.write_end()
9979class UserWriter(Writer): 9980 9981 def __init__(self): 9982 super(UserWriter, self).__init__() 9983 9984 @staticmethod 9985 def write_one(obj, writer, singular=None): 9986 if singular is None: 9987 singular = 'user' 9988 writer.write_start(singular) 9989 href = obj.href 9990 if href is not None: 9991 writer.write_attribute('href', href) 9992 if obj.id is not None: 9993 writer.write_attribute('id', obj.id) 9994 if obj.comment is not None: 9995 Writer.write_string(writer, 'comment', obj.comment) 9996 if obj.department is not None: 9997 Writer.write_string(writer, 'department', obj.department) 9998 if obj.description is not None: 9999 Writer.write_string(writer, 'description', obj.description) 10000 if obj.domain_entry_id is not None: 10001 Writer.write_string(writer, 'domain_entry_id', obj.domain_entry_id) 10002 if obj.email is not None: 10003 Writer.write_string(writer, 'email', obj.email) 10004 if obj.last_name is not None: 10005 Writer.write_string(writer, 'last_name', obj.last_name) 10006 if obj.logged_in is not None: 10007 Writer.write_boolean(writer, 'logged_in', obj.logged_in) 10008 if obj.name is not None: 10009 Writer.write_string(writer, 'name', obj.name) 10010 if obj.namespace is not None: 10011 Writer.write_string(writer, 'namespace', obj.namespace) 10012 if obj.password is not None: 10013 Writer.write_string(writer, 'password', obj.password) 10014 if obj.principal is not None: 10015 Writer.write_string(writer, 'principal', obj.principal) 10016 if obj.user_name is not None: 10017 Writer.write_string(writer, 'user_name', obj.user_name) 10018 if obj.user_options is not None: 10019 PropertyWriter.write_many(obj.user_options, writer, 'property', 'user_options') 10020 if obj.domain is not None: 10021 DomainWriter.write_one(obj.domain, writer, 'domain') 10022 if obj.groups is not None: 10023 GroupWriter.write_many(obj.groups, writer, 'group', 'groups') 10024 if obj.options is not None: 10025 UserOptionWriter.write_many(obj.options, writer, 'user_option', 'options') 10026 if obj.permissions is not None: 10027 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10028 if obj.roles is not None: 10029 RoleWriter.write_many(obj.roles, writer, 'role', 'roles') 10030 if obj.ssh_public_keys is not None: 10031 SshPublicKeyWriter.write_many(obj.ssh_public_keys, writer, 'ssh_public_key', 'ssh_public_keys') 10032 if obj.tags is not None: 10033 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 10034 writer.write_end() 10035 10036 @staticmethod 10037 def write_many(objs, writer, singular=None, plural=None): 10038 if singular is None: 10039 singular = 'user' 10040 if plural is None: 10041 plural = 'users' 10042 writer.write_start(plural) 10043 if isinstance(objs, List): 10044 href = objs.href 10045 if href is not None: 10046 writer.write_attribute('href', href) 10047 for obj in objs: 10048 UserWriter.write_one(obj, writer, singular) 10049 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
9984 @staticmethod 9985 def write_one(obj, writer, singular=None): 9986 if singular is None: 9987 singular = 'user' 9988 writer.write_start(singular) 9989 href = obj.href 9990 if href is not None: 9991 writer.write_attribute('href', href) 9992 if obj.id is not None: 9993 writer.write_attribute('id', obj.id) 9994 if obj.comment is not None: 9995 Writer.write_string(writer, 'comment', obj.comment) 9996 if obj.department is not None: 9997 Writer.write_string(writer, 'department', obj.department) 9998 if obj.description is not None: 9999 Writer.write_string(writer, 'description', obj.description) 10000 if obj.domain_entry_id is not None: 10001 Writer.write_string(writer, 'domain_entry_id', obj.domain_entry_id) 10002 if obj.email is not None: 10003 Writer.write_string(writer, 'email', obj.email) 10004 if obj.last_name is not None: 10005 Writer.write_string(writer, 'last_name', obj.last_name) 10006 if obj.logged_in is not None: 10007 Writer.write_boolean(writer, 'logged_in', obj.logged_in) 10008 if obj.name is not None: 10009 Writer.write_string(writer, 'name', obj.name) 10010 if obj.namespace is not None: 10011 Writer.write_string(writer, 'namespace', obj.namespace) 10012 if obj.password is not None: 10013 Writer.write_string(writer, 'password', obj.password) 10014 if obj.principal is not None: 10015 Writer.write_string(writer, 'principal', obj.principal) 10016 if obj.user_name is not None: 10017 Writer.write_string(writer, 'user_name', obj.user_name) 10018 if obj.user_options is not None: 10019 PropertyWriter.write_many(obj.user_options, writer, 'property', 'user_options') 10020 if obj.domain is not None: 10021 DomainWriter.write_one(obj.domain, writer, 'domain') 10022 if obj.groups is not None: 10023 GroupWriter.write_many(obj.groups, writer, 'group', 'groups') 10024 if obj.options is not None: 10025 UserOptionWriter.write_many(obj.options, writer, 'user_option', 'options') 10026 if obj.permissions is not None: 10027 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10028 if obj.roles is not None: 10029 RoleWriter.write_many(obj.roles, writer, 'role', 'roles') 10030 if obj.ssh_public_keys is not None: 10031 SshPublicKeyWriter.write_many(obj.ssh_public_keys, writer, 'ssh_public_key', 'ssh_public_keys') 10032 if obj.tags is not None: 10033 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 10034 writer.write_end()
10036 @staticmethod 10037 def write_many(objs, writer, singular=None, plural=None): 10038 if singular is None: 10039 singular = 'user' 10040 if plural is None: 10041 plural = 'users' 10042 writer.write_start(plural) 10043 if isinstance(objs, List): 10044 href = objs.href 10045 if href is not None: 10046 writer.write_attribute('href', href) 10047 for obj in objs: 10048 UserWriter.write_one(obj, writer, singular) 10049 writer.write_end()
10052class UserOptionWriter(Writer): 10053 10054 def __init__(self): 10055 super(UserOptionWriter, self).__init__() 10056 10057 @staticmethod 10058 def write_one(obj, writer, singular=None): 10059 if singular is None: 10060 singular = 'user_option' 10061 writer.write_start(singular) 10062 href = obj.href 10063 if href is not None: 10064 writer.write_attribute('href', href) 10065 if obj.id is not None: 10066 writer.write_attribute('id', obj.id) 10067 if obj.comment is not None: 10068 Writer.write_string(writer, 'comment', obj.comment) 10069 if obj.content is not None: 10070 Writer.write_string(writer, 'content', obj.content) 10071 if obj.description is not None: 10072 Writer.write_string(writer, 'description', obj.description) 10073 if obj.name is not None: 10074 Writer.write_string(writer, 'name', obj.name) 10075 if obj.user is not None: 10076 UserWriter.write_one(obj.user, writer, 'user') 10077 writer.write_end() 10078 10079 @staticmethod 10080 def write_many(objs, writer, singular=None, plural=None): 10081 if singular is None: 10082 singular = 'user_option' 10083 if plural is None: 10084 plural = 'user_options' 10085 writer.write_start(plural) 10086 if isinstance(objs, List): 10087 href = objs.href 10088 if href is not None: 10089 writer.write_attribute('href', href) 10090 for obj in objs: 10091 UserOptionWriter.write_one(obj, writer, singular) 10092 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10057 @staticmethod 10058 def write_one(obj, writer, singular=None): 10059 if singular is None: 10060 singular = 'user_option' 10061 writer.write_start(singular) 10062 href = obj.href 10063 if href is not None: 10064 writer.write_attribute('href', href) 10065 if obj.id is not None: 10066 writer.write_attribute('id', obj.id) 10067 if obj.comment is not None: 10068 Writer.write_string(writer, 'comment', obj.comment) 10069 if obj.content is not None: 10070 Writer.write_string(writer, 'content', obj.content) 10071 if obj.description is not None: 10072 Writer.write_string(writer, 'description', obj.description) 10073 if obj.name is not None: 10074 Writer.write_string(writer, 'name', obj.name) 10075 if obj.user is not None: 10076 UserWriter.write_one(obj.user, writer, 'user') 10077 writer.write_end()
10079 @staticmethod 10080 def write_many(objs, writer, singular=None, plural=None): 10081 if singular is None: 10082 singular = 'user_option' 10083 if plural is None: 10084 plural = 'user_options' 10085 writer.write_start(plural) 10086 if isinstance(objs, List): 10087 href = objs.href 10088 if href is not None: 10089 writer.write_attribute('href', href) 10090 for obj in objs: 10091 UserOptionWriter.write_one(obj, writer, singular) 10092 writer.write_end()
10095class ValueWriter(Writer): 10096 10097 def __init__(self): 10098 super(ValueWriter, self).__init__() 10099 10100 @staticmethod 10101 def write_one(obj, writer, singular=None): 10102 if singular is None: 10103 singular = 'value' 10104 writer.write_start(singular) 10105 href = obj.href 10106 if href is not None: 10107 writer.write_attribute('href', href) 10108 if obj.datum is not None: 10109 Writer.write_decimal(writer, 'datum', obj.datum) 10110 if obj.detail is not None: 10111 Writer.write_string(writer, 'detail', obj.detail) 10112 writer.write_end() 10113 10114 @staticmethod 10115 def write_many(objs, writer, singular=None, plural=None): 10116 if singular is None: 10117 singular = 'value' 10118 if plural is None: 10119 plural = 'values' 10120 writer.write_start(plural) 10121 if isinstance(objs, List): 10122 href = objs.href 10123 if href is not None: 10124 writer.write_attribute('href', href) 10125 for obj in objs: 10126 ValueWriter.write_one(obj, writer, singular) 10127 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10100 @staticmethod 10101 def write_one(obj, writer, singular=None): 10102 if singular is None: 10103 singular = 'value' 10104 writer.write_start(singular) 10105 href = obj.href 10106 if href is not None: 10107 writer.write_attribute('href', href) 10108 if obj.datum is not None: 10109 Writer.write_decimal(writer, 'datum', obj.datum) 10110 if obj.detail is not None: 10111 Writer.write_string(writer, 'detail', obj.detail) 10112 writer.write_end()
10114 @staticmethod 10115 def write_many(objs, writer, singular=None, plural=None): 10116 if singular is None: 10117 singular = 'value' 10118 if plural is None: 10119 plural = 'values' 10120 writer.write_start(plural) 10121 if isinstance(objs, List): 10122 href = objs.href 10123 if href is not None: 10124 writer.write_attribute('href', href) 10125 for obj in objs: 10126 ValueWriter.write_one(obj, writer, singular) 10127 writer.write_end()
10130class VcpuPinWriter(Writer): 10131 10132 def __init__(self): 10133 super(VcpuPinWriter, self).__init__() 10134 10135 @staticmethod 10136 def write_one(obj, writer, singular=None): 10137 if singular is None: 10138 singular = 'vcpu_pin' 10139 writer.write_start(singular) 10140 href = obj.href 10141 if href is not None: 10142 writer.write_attribute('href', href) 10143 if obj.cpu_set is not None: 10144 Writer.write_string(writer, 'cpu_set', obj.cpu_set) 10145 if obj.vcpu is not None: 10146 Writer.write_integer(writer, 'vcpu', obj.vcpu) 10147 writer.write_end() 10148 10149 @staticmethod 10150 def write_many(objs, writer, singular=None, plural=None): 10151 if singular is None: 10152 singular = 'vcpu_pin' 10153 if plural is None: 10154 plural = 'vcpu_pins' 10155 writer.write_start(plural) 10156 if isinstance(objs, List): 10157 href = objs.href 10158 if href is not None: 10159 writer.write_attribute('href', href) 10160 for obj in objs: 10161 VcpuPinWriter.write_one(obj, writer, singular) 10162 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10135 @staticmethod 10136 def write_one(obj, writer, singular=None): 10137 if singular is None: 10138 singular = 'vcpu_pin' 10139 writer.write_start(singular) 10140 href = obj.href 10141 if href is not None: 10142 writer.write_attribute('href', href) 10143 if obj.cpu_set is not None: 10144 Writer.write_string(writer, 'cpu_set', obj.cpu_set) 10145 if obj.vcpu is not None: 10146 Writer.write_integer(writer, 'vcpu', obj.vcpu) 10147 writer.write_end()
10149 @staticmethod 10150 def write_many(objs, writer, singular=None, plural=None): 10151 if singular is None: 10152 singular = 'vcpu_pin' 10153 if plural is None: 10154 plural = 'vcpu_pins' 10155 writer.write_start(plural) 10156 if isinstance(objs, List): 10157 href = objs.href 10158 if href is not None: 10159 writer.write_attribute('href', href) 10160 for obj in objs: 10161 VcpuPinWriter.write_one(obj, writer, singular) 10162 writer.write_end()
10165class VendorWriter(Writer): 10166 10167 def __init__(self): 10168 super(VendorWriter, self).__init__() 10169 10170 @staticmethod 10171 def write_one(obj, writer, singular=None): 10172 if singular is None: 10173 singular = 'vendor' 10174 writer.write_start(singular) 10175 href = obj.href 10176 if href is not None: 10177 writer.write_attribute('href', href) 10178 if obj.id is not None: 10179 writer.write_attribute('id', obj.id) 10180 if obj.comment is not None: 10181 Writer.write_string(writer, 'comment', obj.comment) 10182 if obj.description is not None: 10183 Writer.write_string(writer, 'description', obj.description) 10184 if obj.name is not None: 10185 Writer.write_string(writer, 'name', obj.name) 10186 writer.write_end() 10187 10188 @staticmethod 10189 def write_many(objs, writer, singular=None, plural=None): 10190 if singular is None: 10191 singular = 'vendor' 10192 if plural is None: 10193 plural = 'vendors' 10194 writer.write_start(plural) 10195 if isinstance(objs, List): 10196 href = objs.href 10197 if href is not None: 10198 writer.write_attribute('href', href) 10199 for obj in objs: 10200 VendorWriter.write_one(obj, writer, singular) 10201 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10170 @staticmethod 10171 def write_one(obj, writer, singular=None): 10172 if singular is None: 10173 singular = 'vendor' 10174 writer.write_start(singular) 10175 href = obj.href 10176 if href is not None: 10177 writer.write_attribute('href', href) 10178 if obj.id is not None: 10179 writer.write_attribute('id', obj.id) 10180 if obj.comment is not None: 10181 Writer.write_string(writer, 'comment', obj.comment) 10182 if obj.description is not None: 10183 Writer.write_string(writer, 'description', obj.description) 10184 if obj.name is not None: 10185 Writer.write_string(writer, 'name', obj.name) 10186 writer.write_end()
10188 @staticmethod 10189 def write_many(objs, writer, singular=None, plural=None): 10190 if singular is None: 10191 singular = 'vendor' 10192 if plural is None: 10193 plural = 'vendors' 10194 writer.write_start(plural) 10195 if isinstance(objs, List): 10196 href = objs.href 10197 if href is not None: 10198 writer.write_attribute('href', href) 10199 for obj in objs: 10200 VendorWriter.write_one(obj, writer, singular) 10201 writer.write_end()
10204class VersionWriter(Writer): 10205 10206 def __init__(self): 10207 super(VersionWriter, self).__init__() 10208 10209 @staticmethod 10210 def write_one(obj, writer, singular=None): 10211 if singular is None: 10212 singular = 'version' 10213 writer.write_start(singular) 10214 href = obj.href 10215 if href is not None: 10216 writer.write_attribute('href', href) 10217 if obj.id is not None: 10218 writer.write_attribute('id', obj.id) 10219 if obj.build is not None: 10220 Writer.write_integer(writer, 'build', obj.build) 10221 if obj.comment is not None: 10222 Writer.write_string(writer, 'comment', obj.comment) 10223 if obj.description is not None: 10224 Writer.write_string(writer, 'description', obj.description) 10225 if obj.full_version is not None: 10226 Writer.write_string(writer, 'full_version', obj.full_version) 10227 if obj.major is not None: 10228 Writer.write_integer(writer, 'major', obj.major) 10229 if obj.minor is not None: 10230 Writer.write_integer(writer, 'minor', obj.minor) 10231 if obj.name is not None: 10232 Writer.write_string(writer, 'name', obj.name) 10233 if obj.revision is not None: 10234 Writer.write_integer(writer, 'revision', obj.revision) 10235 writer.write_end() 10236 10237 @staticmethod 10238 def write_many(objs, writer, singular=None, plural=None): 10239 if singular is None: 10240 singular = 'version' 10241 if plural is None: 10242 plural = 'versions' 10243 writer.write_start(plural) 10244 if isinstance(objs, List): 10245 href = objs.href 10246 if href is not None: 10247 writer.write_attribute('href', href) 10248 for obj in objs: 10249 VersionWriter.write_one(obj, writer, singular) 10250 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10209 @staticmethod 10210 def write_one(obj, writer, singular=None): 10211 if singular is None: 10212 singular = 'version' 10213 writer.write_start(singular) 10214 href = obj.href 10215 if href is not None: 10216 writer.write_attribute('href', href) 10217 if obj.id is not None: 10218 writer.write_attribute('id', obj.id) 10219 if obj.build is not None: 10220 Writer.write_integer(writer, 'build', obj.build) 10221 if obj.comment is not None: 10222 Writer.write_string(writer, 'comment', obj.comment) 10223 if obj.description is not None: 10224 Writer.write_string(writer, 'description', obj.description) 10225 if obj.full_version is not None: 10226 Writer.write_string(writer, 'full_version', obj.full_version) 10227 if obj.major is not None: 10228 Writer.write_integer(writer, 'major', obj.major) 10229 if obj.minor is not None: 10230 Writer.write_integer(writer, 'minor', obj.minor) 10231 if obj.name is not None: 10232 Writer.write_string(writer, 'name', obj.name) 10233 if obj.revision is not None: 10234 Writer.write_integer(writer, 'revision', obj.revision) 10235 writer.write_end()
10237 @staticmethod 10238 def write_many(objs, writer, singular=None, plural=None): 10239 if singular is None: 10240 singular = 'version' 10241 if plural is None: 10242 plural = 'versions' 10243 writer.write_start(plural) 10244 if isinstance(objs, List): 10245 href = objs.href 10246 if href is not None: 10247 writer.write_attribute('href', href) 10248 for obj in objs: 10249 VersionWriter.write_one(obj, writer, singular) 10250 writer.write_end()
10253class VirtioScsiWriter(Writer): 10254 10255 def __init__(self): 10256 super(VirtioScsiWriter, self).__init__() 10257 10258 @staticmethod 10259 def write_one(obj, writer, singular=None): 10260 if singular is None: 10261 singular = 'virtio_scsi' 10262 writer.write_start(singular) 10263 href = obj.href 10264 if href is not None: 10265 writer.write_attribute('href', href) 10266 if obj.enabled is not None: 10267 Writer.write_boolean(writer, 'enabled', obj.enabled) 10268 writer.write_end() 10269 10270 @staticmethod 10271 def write_many(objs, writer, singular=None, plural=None): 10272 if singular is None: 10273 singular = 'virtio_scsi' 10274 if plural is None: 10275 plural = 'virtio_scsis' 10276 writer.write_start(plural) 10277 if isinstance(objs, List): 10278 href = objs.href 10279 if href is not None: 10280 writer.write_attribute('href', href) 10281 for obj in objs: 10282 VirtioScsiWriter.write_one(obj, writer, singular) 10283 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10258 @staticmethod 10259 def write_one(obj, writer, singular=None): 10260 if singular is None: 10261 singular = 'virtio_scsi' 10262 writer.write_start(singular) 10263 href = obj.href 10264 if href is not None: 10265 writer.write_attribute('href', href) 10266 if obj.enabled is not None: 10267 Writer.write_boolean(writer, 'enabled', obj.enabled) 10268 writer.write_end()
10270 @staticmethod 10271 def write_many(objs, writer, singular=None, plural=None): 10272 if singular is None: 10273 singular = 'virtio_scsi' 10274 if plural is None: 10275 plural = 'virtio_scsis' 10276 writer.write_start(plural) 10277 if isinstance(objs, List): 10278 href = objs.href 10279 if href is not None: 10280 writer.write_attribute('href', href) 10281 for obj in objs: 10282 VirtioScsiWriter.write_one(obj, writer, singular) 10283 writer.write_end()
10286class VirtualNumaNodeWriter(Writer): 10287 10288 def __init__(self): 10289 super(VirtualNumaNodeWriter, self).__init__() 10290 10291 @staticmethod 10292 def write_one(obj, writer, singular=None): 10293 if singular is None: 10294 singular = 'vm_numa_node' 10295 writer.write_start(singular) 10296 href = obj.href 10297 if href is not None: 10298 writer.write_attribute('href', href) 10299 if obj.id is not None: 10300 writer.write_attribute('id', obj.id) 10301 if obj.comment is not None: 10302 Writer.write_string(writer, 'comment', obj.comment) 10303 if obj.cpu is not None: 10304 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10305 if obj.description is not None: 10306 Writer.write_string(writer, 'description', obj.description) 10307 if obj.index is not None: 10308 Writer.write_integer(writer, 'index', obj.index) 10309 if obj.memory is not None: 10310 Writer.write_integer(writer, 'memory', obj.memory) 10311 if obj.name is not None: 10312 Writer.write_string(writer, 'name', obj.name) 10313 if obj.node_distance is not None: 10314 Writer.write_string(writer, 'node_distance', obj.node_distance) 10315 if obj.numa_node_pins is not None: 10316 NumaNodePinWriter.write_many(obj.numa_node_pins, writer, 'numa_node_pin', 'numa_node_pins') 10317 if obj.numa_tune_mode is not None: 10318 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 10319 if obj.host is not None: 10320 HostWriter.write_one(obj.host, writer, 'host') 10321 if obj.statistics is not None: 10322 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 10323 if obj.vm is not None: 10324 VmWriter.write_one(obj.vm, writer, 'vm') 10325 writer.write_end() 10326 10327 @staticmethod 10328 def write_many(objs, writer, singular=None, plural=None): 10329 if singular is None: 10330 singular = 'vm_numa_node' 10331 if plural is None: 10332 plural = 'vm_numa_nodes' 10333 writer.write_start(plural) 10334 if isinstance(objs, List): 10335 href = objs.href 10336 if href is not None: 10337 writer.write_attribute('href', href) 10338 for obj in objs: 10339 VirtualNumaNodeWriter.write_one(obj, writer, singular) 10340 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10291 @staticmethod 10292 def write_one(obj, writer, singular=None): 10293 if singular is None: 10294 singular = 'vm_numa_node' 10295 writer.write_start(singular) 10296 href = obj.href 10297 if href is not None: 10298 writer.write_attribute('href', href) 10299 if obj.id is not None: 10300 writer.write_attribute('id', obj.id) 10301 if obj.comment is not None: 10302 Writer.write_string(writer, 'comment', obj.comment) 10303 if obj.cpu is not None: 10304 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10305 if obj.description is not None: 10306 Writer.write_string(writer, 'description', obj.description) 10307 if obj.index is not None: 10308 Writer.write_integer(writer, 'index', obj.index) 10309 if obj.memory is not None: 10310 Writer.write_integer(writer, 'memory', obj.memory) 10311 if obj.name is not None: 10312 Writer.write_string(writer, 'name', obj.name) 10313 if obj.node_distance is not None: 10314 Writer.write_string(writer, 'node_distance', obj.node_distance) 10315 if obj.numa_node_pins is not None: 10316 NumaNodePinWriter.write_many(obj.numa_node_pins, writer, 'numa_node_pin', 'numa_node_pins') 10317 if obj.numa_tune_mode is not None: 10318 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 10319 if obj.host is not None: 10320 HostWriter.write_one(obj.host, writer, 'host') 10321 if obj.statistics is not None: 10322 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 10323 if obj.vm is not None: 10324 VmWriter.write_one(obj.vm, writer, 'vm') 10325 writer.write_end()
10327 @staticmethod 10328 def write_many(objs, writer, singular=None, plural=None): 10329 if singular is None: 10330 singular = 'vm_numa_node' 10331 if plural is None: 10332 plural = 'vm_numa_nodes' 10333 writer.write_start(plural) 10334 if isinstance(objs, List): 10335 href = objs.href 10336 if href is not None: 10337 writer.write_attribute('href', href) 10338 for obj in objs: 10339 VirtualNumaNodeWriter.write_one(obj, writer, singular) 10340 writer.write_end()
10343class VlanWriter(Writer): 10344 10345 def __init__(self): 10346 super(VlanWriter, self).__init__() 10347 10348 @staticmethod 10349 def write_one(obj, writer, singular=None): 10350 if singular is None: 10351 singular = 'vlan' 10352 writer.write_start(singular) 10353 href = obj.href 10354 if href is not None: 10355 writer.write_attribute('href', href) 10356 if obj.id is not None: 10357 writer.write_attribute('id', str(obj.id)) 10358 writer.write_end() 10359 10360 @staticmethod 10361 def write_many(objs, writer, singular=None, plural=None): 10362 if singular is None: 10363 singular = 'vlan' 10364 if plural is None: 10365 plural = 'vlans' 10366 writer.write_start(plural) 10367 if isinstance(objs, List): 10368 href = objs.href 10369 if href is not None: 10370 writer.write_attribute('href', href) 10371 for obj in objs: 10372 VlanWriter.write_one(obj, writer, singular) 10373 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10348 @staticmethod 10349 def write_one(obj, writer, singular=None): 10350 if singular is None: 10351 singular = 'vlan' 10352 writer.write_start(singular) 10353 href = obj.href 10354 if href is not None: 10355 writer.write_attribute('href', href) 10356 if obj.id is not None: 10357 writer.write_attribute('id', str(obj.id)) 10358 writer.write_end()
10360 @staticmethod 10361 def write_many(objs, writer, singular=None, plural=None): 10362 if singular is None: 10363 singular = 'vlan' 10364 if plural is None: 10365 plural = 'vlans' 10366 writer.write_start(plural) 10367 if isinstance(objs, List): 10368 href = objs.href 10369 if href is not None: 10370 writer.write_attribute('href', href) 10371 for obj in objs: 10372 VlanWriter.write_one(obj, writer, singular) 10373 writer.write_end()
10376class VmWriter(Writer): 10377 10378 def __init__(self): 10379 super(VmWriter, self).__init__() 10380 10381 @staticmethod 10382 def write_one(obj, writer, singular=None): 10383 if singular is None: 10384 singular = 'vm' 10385 writer.write_start(singular) 10386 href = obj.href 10387 if href is not None: 10388 writer.write_attribute('href', href) 10389 if obj.id is not None: 10390 writer.write_attribute('id', obj.id) 10391 if obj.auto_pinning_policy is not None: 10392 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 10393 if obj.bios is not None: 10394 BiosWriter.write_one(obj.bios, writer, 'bios') 10395 if obj.comment is not None: 10396 Writer.write_string(writer, 'comment', obj.comment) 10397 if obj.console is not None: 10398 ConsoleWriter.write_one(obj.console, writer, 'console') 10399 if obj.cpu is not None: 10400 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10401 if obj.cpu_pinning_policy is not None: 10402 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 10403 if obj.cpu_shares is not None: 10404 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 10405 if obj.creation_time is not None: 10406 Writer.write_date(writer, 'creation_time', obj.creation_time) 10407 if obj.custom_compatibility_version is not None: 10408 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 10409 if obj.custom_cpu_model is not None: 10410 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 10411 if obj.custom_emulated_machine is not None: 10412 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 10413 if obj.custom_properties is not None: 10414 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10415 if obj.delete_protected is not None: 10416 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 10417 if obj.description is not None: 10418 Writer.write_string(writer, 'description', obj.description) 10419 if obj.display is not None: 10420 DisplayWriter.write_one(obj.display, writer, 'display') 10421 if obj.domain is not None: 10422 DomainWriter.write_one(obj.domain, writer, 'domain') 10423 if obj.fqdn is not None: 10424 Writer.write_string(writer, 'fqdn', obj.fqdn) 10425 if obj.guest_operating_system is not None: 10426 GuestOperatingSystemWriter.write_one(obj.guest_operating_system, writer, 'guest_operating_system') 10427 if obj.guest_time_zone is not None: 10428 TimeZoneWriter.write_one(obj.guest_time_zone, writer, 'guest_time_zone') 10429 if obj.has_illegal_images is not None: 10430 Writer.write_boolean(writer, 'has_illegal_images', obj.has_illegal_images) 10431 if obj.high_availability is not None: 10432 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 10433 if obj.initialization is not None: 10434 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 10435 if obj.io is not None: 10436 IoWriter.write_one(obj.io, writer, 'io') 10437 if obj.large_icon is not None: 10438 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 10439 if obj.lease is not None: 10440 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 10441 if obj.memory is not None: 10442 Writer.write_integer(writer, 'memory', obj.memory) 10443 if obj.memory_policy is not None: 10444 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 10445 if obj.migration is not None: 10446 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 10447 if obj.migration_downtime is not None: 10448 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 10449 if obj.multi_queues_enabled is not None: 10450 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 10451 if obj.name is not None: 10452 Writer.write_string(writer, 'name', obj.name) 10453 if obj.next_run_configuration_exists is not None: 10454 Writer.write_boolean(writer, 'next_run_configuration_exists', obj.next_run_configuration_exists) 10455 if obj.numa_tune_mode is not None: 10456 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 10457 if obj.origin is not None: 10458 Writer.write_string(writer, 'origin', obj.origin) 10459 if obj.os is not None: 10460 OperatingSystemWriter.write_one(obj.os, writer, 'os') 10461 if obj.payloads is not None: 10462 PayloadWriter.write_many(obj.payloads, writer, 'payload', 'payloads') 10463 if obj.placement_policy is not None: 10464 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 10465 if obj.rng_device is not None: 10466 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10467 if obj.run_once is not None: 10468 Writer.write_boolean(writer, 'run_once', obj.run_once) 10469 if obj.serial_number is not None: 10470 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 10471 if obj.small_icon is not None: 10472 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 10473 if obj.soundcard_enabled is not None: 10474 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10475 if obj.sso is not None: 10476 SsoWriter.write_one(obj.sso, writer, 'sso') 10477 if obj.start_paused is not None: 10478 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 10479 if obj.start_time is not None: 10480 Writer.write_date(writer, 'start_time', obj.start_time) 10481 if obj.stateless is not None: 10482 Writer.write_boolean(writer, 'stateless', obj.stateless) 10483 if obj.status is not None: 10484 Writer.write_string(writer, 'status', obj.status.value) 10485 if obj.status_detail is not None: 10486 Writer.write_string(writer, 'status_detail', obj.status_detail) 10487 if obj.stop_reason is not None: 10488 Writer.write_string(writer, 'stop_reason', obj.stop_reason) 10489 if obj.stop_time is not None: 10490 Writer.write_date(writer, 'stop_time', obj.stop_time) 10491 if obj.storage_error_resume_behaviour is not None: 10492 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 10493 if obj.time_zone is not None: 10494 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 10495 if obj.tpm_enabled is not None: 10496 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10497 if obj.tunnel_migration is not None: 10498 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 10499 if obj.type is not None: 10500 Writer.write_string(writer, 'type', obj.type.value) 10501 if obj.usb is not None: 10502 UsbWriter.write_one(obj.usb, writer, 'usb') 10503 if obj.use_latest_template_version is not None: 10504 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 10505 if obj.virtio_scsi is not None: 10506 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 10507 if obj.virtio_scsi_multi_queues is not None: 10508 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 10509 if obj.virtio_scsi_multi_queues_enabled is not None: 10510 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 10511 if obj.affinity_labels is not None: 10512 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 10513 if obj.applications is not None: 10514 ApplicationWriter.write_many(obj.applications, writer, 'application', 'applications') 10515 if obj.cdroms is not None: 10516 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 10517 if obj.cluster is not None: 10518 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10519 if obj.cpu_profile is not None: 10520 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 10521 if obj.disk_attachments is not None: 10522 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 10523 if obj.dynamic_cpu is not None: 10524 DynamicCpuWriter.write_one(obj.dynamic_cpu, writer, 'dynamic_cpu') 10525 if obj.external_host_provider is not None: 10526 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 10527 if obj.floppies is not None: 10528 FloppyWriter.write_many(obj.floppies, writer, 'floppy', 'floppies') 10529 if obj.graphics_consoles is not None: 10530 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 10531 if obj.host is not None: 10532 HostWriter.write_one(obj.host, writer, 'host') 10533 if obj.host_devices is not None: 10534 HostDeviceWriter.write_many(obj.host_devices, writer, 'host_device', 'host_devices') 10535 if obj.instance_type is not None: 10536 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10537 if obj.katello_errata is not None: 10538 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 10539 if obj.mediated_devices is not None: 10540 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 10541 if obj.nics is not None: 10542 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 10543 if obj.numa_nodes is not None: 10544 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 10545 if obj.original_template is not None: 10546 TemplateWriter.write_one(obj.original_template, writer, 'original_template') 10547 if obj.permissions is not None: 10548 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10549 if obj.quota is not None: 10550 QuotaWriter.write_one(obj.quota, writer, 'quota') 10551 if obj.reported_devices is not None: 10552 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 10553 if obj.sessions is not None: 10554 SessionWriter.write_many(obj.sessions, writer, 'session', 'sessions') 10555 if obj.snapshots is not None: 10556 SnapshotWriter.write_many(obj.snapshots, writer, 'snapshot', 'snapshots') 10557 if obj.statistics is not None: 10558 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 10559 if obj.storage_domain is not None: 10560 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 10561 if obj.tags is not None: 10562 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 10563 if obj.template is not None: 10564 TemplateWriter.write_one(obj.template, writer, 'template') 10565 if obj.vm_pool is not None: 10566 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 10567 if obj.watchdogs is not None: 10568 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 10569 writer.write_end() 10570 10571 @staticmethod 10572 def write_many(objs, writer, singular=None, plural=None): 10573 if singular is None: 10574 singular = 'vm' 10575 if plural is None: 10576 plural = 'vms' 10577 writer.write_start(plural) 10578 if isinstance(objs, List): 10579 href = objs.href 10580 if href is not None: 10581 writer.write_attribute('href', href) 10582 for obj in objs: 10583 VmWriter.write_one(obj, writer, singular) 10584 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10381 @staticmethod 10382 def write_one(obj, writer, singular=None): 10383 if singular is None: 10384 singular = 'vm' 10385 writer.write_start(singular) 10386 href = obj.href 10387 if href is not None: 10388 writer.write_attribute('href', href) 10389 if obj.id is not None: 10390 writer.write_attribute('id', obj.id) 10391 if obj.auto_pinning_policy is not None: 10392 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 10393 if obj.bios is not None: 10394 BiosWriter.write_one(obj.bios, writer, 'bios') 10395 if obj.comment is not None: 10396 Writer.write_string(writer, 'comment', obj.comment) 10397 if obj.console is not None: 10398 ConsoleWriter.write_one(obj.console, writer, 'console') 10399 if obj.cpu is not None: 10400 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10401 if obj.cpu_pinning_policy is not None: 10402 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 10403 if obj.cpu_shares is not None: 10404 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 10405 if obj.creation_time is not None: 10406 Writer.write_date(writer, 'creation_time', obj.creation_time) 10407 if obj.custom_compatibility_version is not None: 10408 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 10409 if obj.custom_cpu_model is not None: 10410 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 10411 if obj.custom_emulated_machine is not None: 10412 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 10413 if obj.custom_properties is not None: 10414 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10415 if obj.delete_protected is not None: 10416 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 10417 if obj.description is not None: 10418 Writer.write_string(writer, 'description', obj.description) 10419 if obj.display is not None: 10420 DisplayWriter.write_one(obj.display, writer, 'display') 10421 if obj.domain is not None: 10422 DomainWriter.write_one(obj.domain, writer, 'domain') 10423 if obj.fqdn is not None: 10424 Writer.write_string(writer, 'fqdn', obj.fqdn) 10425 if obj.guest_operating_system is not None: 10426 GuestOperatingSystemWriter.write_one(obj.guest_operating_system, writer, 'guest_operating_system') 10427 if obj.guest_time_zone is not None: 10428 TimeZoneWriter.write_one(obj.guest_time_zone, writer, 'guest_time_zone') 10429 if obj.has_illegal_images is not None: 10430 Writer.write_boolean(writer, 'has_illegal_images', obj.has_illegal_images) 10431 if obj.high_availability is not None: 10432 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 10433 if obj.initialization is not None: 10434 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 10435 if obj.io is not None: 10436 IoWriter.write_one(obj.io, writer, 'io') 10437 if obj.large_icon is not None: 10438 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 10439 if obj.lease is not None: 10440 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 10441 if obj.memory is not None: 10442 Writer.write_integer(writer, 'memory', obj.memory) 10443 if obj.memory_policy is not None: 10444 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 10445 if obj.migration is not None: 10446 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 10447 if obj.migration_downtime is not None: 10448 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 10449 if obj.multi_queues_enabled is not None: 10450 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 10451 if obj.name is not None: 10452 Writer.write_string(writer, 'name', obj.name) 10453 if obj.next_run_configuration_exists is not None: 10454 Writer.write_boolean(writer, 'next_run_configuration_exists', obj.next_run_configuration_exists) 10455 if obj.numa_tune_mode is not None: 10456 Writer.write_string(writer, 'numa_tune_mode', obj.numa_tune_mode.value) 10457 if obj.origin is not None: 10458 Writer.write_string(writer, 'origin', obj.origin) 10459 if obj.os is not None: 10460 OperatingSystemWriter.write_one(obj.os, writer, 'os') 10461 if obj.payloads is not None: 10462 PayloadWriter.write_many(obj.payloads, writer, 'payload', 'payloads') 10463 if obj.placement_policy is not None: 10464 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 10465 if obj.rng_device is not None: 10466 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10467 if obj.run_once is not None: 10468 Writer.write_boolean(writer, 'run_once', obj.run_once) 10469 if obj.serial_number is not None: 10470 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 10471 if obj.small_icon is not None: 10472 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 10473 if obj.soundcard_enabled is not None: 10474 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10475 if obj.sso is not None: 10476 SsoWriter.write_one(obj.sso, writer, 'sso') 10477 if obj.start_paused is not None: 10478 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 10479 if obj.start_time is not None: 10480 Writer.write_date(writer, 'start_time', obj.start_time) 10481 if obj.stateless is not None: 10482 Writer.write_boolean(writer, 'stateless', obj.stateless) 10483 if obj.status is not None: 10484 Writer.write_string(writer, 'status', obj.status.value) 10485 if obj.status_detail is not None: 10486 Writer.write_string(writer, 'status_detail', obj.status_detail) 10487 if obj.stop_reason is not None: 10488 Writer.write_string(writer, 'stop_reason', obj.stop_reason) 10489 if obj.stop_time is not None: 10490 Writer.write_date(writer, 'stop_time', obj.stop_time) 10491 if obj.storage_error_resume_behaviour is not None: 10492 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 10493 if obj.time_zone is not None: 10494 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 10495 if obj.tpm_enabled is not None: 10496 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10497 if obj.tunnel_migration is not None: 10498 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 10499 if obj.type is not None: 10500 Writer.write_string(writer, 'type', obj.type.value) 10501 if obj.usb is not None: 10502 UsbWriter.write_one(obj.usb, writer, 'usb') 10503 if obj.use_latest_template_version is not None: 10504 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 10505 if obj.virtio_scsi is not None: 10506 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 10507 if obj.virtio_scsi_multi_queues is not None: 10508 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 10509 if obj.virtio_scsi_multi_queues_enabled is not None: 10510 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 10511 if obj.affinity_labels is not None: 10512 AffinityLabelWriter.write_many(obj.affinity_labels, writer, 'affinity_label', 'affinity_labels') 10513 if obj.applications is not None: 10514 ApplicationWriter.write_many(obj.applications, writer, 'application', 'applications') 10515 if obj.cdroms is not None: 10516 CdromWriter.write_many(obj.cdroms, writer, 'cdrom', 'cdroms') 10517 if obj.cluster is not None: 10518 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10519 if obj.cpu_profile is not None: 10520 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 10521 if obj.disk_attachments is not None: 10522 DiskAttachmentWriter.write_many(obj.disk_attachments, writer, 'disk_attachment', 'disk_attachments') 10523 if obj.dynamic_cpu is not None: 10524 DynamicCpuWriter.write_one(obj.dynamic_cpu, writer, 'dynamic_cpu') 10525 if obj.external_host_provider is not None: 10526 ExternalHostProviderWriter.write_one(obj.external_host_provider, writer, 'external_host_provider') 10527 if obj.floppies is not None: 10528 FloppyWriter.write_many(obj.floppies, writer, 'floppy', 'floppies') 10529 if obj.graphics_consoles is not None: 10530 GraphicsConsoleWriter.write_many(obj.graphics_consoles, writer, 'graphics_console', 'graphics_consoles') 10531 if obj.host is not None: 10532 HostWriter.write_one(obj.host, writer, 'host') 10533 if obj.host_devices is not None: 10534 HostDeviceWriter.write_many(obj.host_devices, writer, 'host_device', 'host_devices') 10535 if obj.instance_type is not None: 10536 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10537 if obj.katello_errata is not None: 10538 KatelloErratumWriter.write_many(obj.katello_errata, writer, 'katello_erratum', 'katello_errata') 10539 if obj.mediated_devices is not None: 10540 VmMediatedDeviceWriter.write_many(obj.mediated_devices, writer, 'vm_mediated_device', 'mediated_devices') 10541 if obj.nics is not None: 10542 NicWriter.write_many(obj.nics, writer, 'nic', 'nics') 10543 if obj.numa_nodes is not None: 10544 NumaNodeWriter.write_many(obj.numa_nodes, writer, 'host_numa_node', 'host_numa_nodes') 10545 if obj.original_template is not None: 10546 TemplateWriter.write_one(obj.original_template, writer, 'original_template') 10547 if obj.permissions is not None: 10548 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10549 if obj.quota is not None: 10550 QuotaWriter.write_one(obj.quota, writer, 'quota') 10551 if obj.reported_devices is not None: 10552 ReportedDeviceWriter.write_many(obj.reported_devices, writer, 'reported_device', 'reported_devices') 10553 if obj.sessions is not None: 10554 SessionWriter.write_many(obj.sessions, writer, 'session', 'sessions') 10555 if obj.snapshots is not None: 10556 SnapshotWriter.write_many(obj.snapshots, writer, 'snapshot', 'snapshots') 10557 if obj.statistics is not None: 10558 StatisticWriter.write_many(obj.statistics, writer, 'statistic', 'statistics') 10559 if obj.storage_domain is not None: 10560 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 10561 if obj.tags is not None: 10562 TagWriter.write_many(obj.tags, writer, 'tag', 'tags') 10563 if obj.template is not None: 10564 TemplateWriter.write_one(obj.template, writer, 'template') 10565 if obj.vm_pool is not None: 10566 VmPoolWriter.write_one(obj.vm_pool, writer, 'vm_pool') 10567 if obj.watchdogs is not None: 10568 WatchdogWriter.write_many(obj.watchdogs, writer, 'watchdog', 'watchdogs') 10569 writer.write_end()
10571 @staticmethod 10572 def write_many(objs, writer, singular=None, plural=None): 10573 if singular is None: 10574 singular = 'vm' 10575 if plural is None: 10576 plural = 'vms' 10577 writer.write_start(plural) 10578 if isinstance(objs, List): 10579 href = objs.href 10580 if href is not None: 10581 writer.write_attribute('href', href) 10582 for obj in objs: 10583 VmWriter.write_one(obj, writer, singular) 10584 writer.write_end()
10587class VmBaseWriter(Writer): 10588 10589 def __init__(self): 10590 super(VmBaseWriter, self).__init__() 10591 10592 @staticmethod 10593 def write_one(obj, writer, singular=None): 10594 if singular is None: 10595 singular = 'vm_base' 10596 writer.write_start(singular) 10597 href = obj.href 10598 if href is not None: 10599 writer.write_attribute('href', href) 10600 if obj.id is not None: 10601 writer.write_attribute('id', obj.id) 10602 if obj.auto_pinning_policy is not None: 10603 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 10604 if obj.bios is not None: 10605 BiosWriter.write_one(obj.bios, writer, 'bios') 10606 if obj.comment is not None: 10607 Writer.write_string(writer, 'comment', obj.comment) 10608 if obj.console is not None: 10609 ConsoleWriter.write_one(obj.console, writer, 'console') 10610 if obj.cpu is not None: 10611 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10612 if obj.cpu_pinning_policy is not None: 10613 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 10614 if obj.cpu_shares is not None: 10615 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 10616 if obj.creation_time is not None: 10617 Writer.write_date(writer, 'creation_time', obj.creation_time) 10618 if obj.custom_compatibility_version is not None: 10619 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 10620 if obj.custom_cpu_model is not None: 10621 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 10622 if obj.custom_emulated_machine is not None: 10623 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 10624 if obj.custom_properties is not None: 10625 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10626 if obj.delete_protected is not None: 10627 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 10628 if obj.description is not None: 10629 Writer.write_string(writer, 'description', obj.description) 10630 if obj.display is not None: 10631 DisplayWriter.write_one(obj.display, writer, 'display') 10632 if obj.domain is not None: 10633 DomainWriter.write_one(obj.domain, writer, 'domain') 10634 if obj.high_availability is not None: 10635 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 10636 if obj.initialization is not None: 10637 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 10638 if obj.io is not None: 10639 IoWriter.write_one(obj.io, writer, 'io') 10640 if obj.large_icon is not None: 10641 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 10642 if obj.lease is not None: 10643 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 10644 if obj.memory is not None: 10645 Writer.write_integer(writer, 'memory', obj.memory) 10646 if obj.memory_policy is not None: 10647 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 10648 if obj.migration is not None: 10649 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 10650 if obj.migration_downtime is not None: 10651 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 10652 if obj.multi_queues_enabled is not None: 10653 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 10654 if obj.name is not None: 10655 Writer.write_string(writer, 'name', obj.name) 10656 if obj.origin is not None: 10657 Writer.write_string(writer, 'origin', obj.origin) 10658 if obj.os is not None: 10659 OperatingSystemWriter.write_one(obj.os, writer, 'os') 10660 if obj.placement_policy is not None: 10661 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 10662 if obj.rng_device is not None: 10663 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10664 if obj.serial_number is not None: 10665 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 10666 if obj.small_icon is not None: 10667 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 10668 if obj.soundcard_enabled is not None: 10669 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10670 if obj.sso is not None: 10671 SsoWriter.write_one(obj.sso, writer, 'sso') 10672 if obj.start_paused is not None: 10673 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 10674 if obj.stateless is not None: 10675 Writer.write_boolean(writer, 'stateless', obj.stateless) 10676 if obj.storage_error_resume_behaviour is not None: 10677 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 10678 if obj.time_zone is not None: 10679 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 10680 if obj.tpm_enabled is not None: 10681 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10682 if obj.tunnel_migration is not None: 10683 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 10684 if obj.type is not None: 10685 Writer.write_string(writer, 'type', obj.type.value) 10686 if obj.usb is not None: 10687 UsbWriter.write_one(obj.usb, writer, 'usb') 10688 if obj.virtio_scsi is not None: 10689 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 10690 if obj.virtio_scsi_multi_queues is not None: 10691 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 10692 if obj.virtio_scsi_multi_queues_enabled is not None: 10693 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 10694 if obj.cluster is not None: 10695 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10696 if obj.cpu_profile is not None: 10697 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 10698 if obj.quota is not None: 10699 QuotaWriter.write_one(obj.quota, writer, 'quota') 10700 if obj.storage_domain is not None: 10701 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 10702 writer.write_end() 10703 10704 @staticmethod 10705 def write_many(objs, writer, singular=None, plural=None): 10706 if singular is None: 10707 singular = 'vm_base' 10708 if plural is None: 10709 plural = 'vm_bases' 10710 writer.write_start(plural) 10711 if isinstance(objs, List): 10712 href = objs.href 10713 if href is not None: 10714 writer.write_attribute('href', href) 10715 for obj in objs: 10716 VmBaseWriter.write_one(obj, writer, singular) 10717 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10592 @staticmethod 10593 def write_one(obj, writer, singular=None): 10594 if singular is None: 10595 singular = 'vm_base' 10596 writer.write_start(singular) 10597 href = obj.href 10598 if href is not None: 10599 writer.write_attribute('href', href) 10600 if obj.id is not None: 10601 writer.write_attribute('id', obj.id) 10602 if obj.auto_pinning_policy is not None: 10603 Writer.write_string(writer, 'auto_pinning_policy', obj.auto_pinning_policy.value) 10604 if obj.bios is not None: 10605 BiosWriter.write_one(obj.bios, writer, 'bios') 10606 if obj.comment is not None: 10607 Writer.write_string(writer, 'comment', obj.comment) 10608 if obj.console is not None: 10609 ConsoleWriter.write_one(obj.console, writer, 'console') 10610 if obj.cpu is not None: 10611 CpuWriter.write_one(obj.cpu, writer, 'cpu') 10612 if obj.cpu_pinning_policy is not None: 10613 Writer.write_string(writer, 'cpu_pinning_policy', obj.cpu_pinning_policy.value) 10614 if obj.cpu_shares is not None: 10615 Writer.write_integer(writer, 'cpu_shares', obj.cpu_shares) 10616 if obj.creation_time is not None: 10617 Writer.write_date(writer, 'creation_time', obj.creation_time) 10618 if obj.custom_compatibility_version is not None: 10619 VersionWriter.write_one(obj.custom_compatibility_version, writer, 'custom_compatibility_version') 10620 if obj.custom_cpu_model is not None: 10621 Writer.write_string(writer, 'custom_cpu_model', obj.custom_cpu_model) 10622 if obj.custom_emulated_machine is not None: 10623 Writer.write_string(writer, 'custom_emulated_machine', obj.custom_emulated_machine) 10624 if obj.custom_properties is not None: 10625 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10626 if obj.delete_protected is not None: 10627 Writer.write_boolean(writer, 'delete_protected', obj.delete_protected) 10628 if obj.description is not None: 10629 Writer.write_string(writer, 'description', obj.description) 10630 if obj.display is not None: 10631 DisplayWriter.write_one(obj.display, writer, 'display') 10632 if obj.domain is not None: 10633 DomainWriter.write_one(obj.domain, writer, 'domain') 10634 if obj.high_availability is not None: 10635 HighAvailabilityWriter.write_one(obj.high_availability, writer, 'high_availability') 10636 if obj.initialization is not None: 10637 InitializationWriter.write_one(obj.initialization, writer, 'initialization') 10638 if obj.io is not None: 10639 IoWriter.write_one(obj.io, writer, 'io') 10640 if obj.large_icon is not None: 10641 IconWriter.write_one(obj.large_icon, writer, 'large_icon') 10642 if obj.lease is not None: 10643 StorageDomainLeaseWriter.write_one(obj.lease, writer, 'lease') 10644 if obj.memory is not None: 10645 Writer.write_integer(writer, 'memory', obj.memory) 10646 if obj.memory_policy is not None: 10647 MemoryPolicyWriter.write_one(obj.memory_policy, writer, 'memory_policy') 10648 if obj.migration is not None: 10649 MigrationOptionsWriter.write_one(obj.migration, writer, 'migration') 10650 if obj.migration_downtime is not None: 10651 Writer.write_integer(writer, 'migration_downtime', obj.migration_downtime) 10652 if obj.multi_queues_enabled is not None: 10653 Writer.write_boolean(writer, 'multi_queues_enabled', obj.multi_queues_enabled) 10654 if obj.name is not None: 10655 Writer.write_string(writer, 'name', obj.name) 10656 if obj.origin is not None: 10657 Writer.write_string(writer, 'origin', obj.origin) 10658 if obj.os is not None: 10659 OperatingSystemWriter.write_one(obj.os, writer, 'os') 10660 if obj.placement_policy is not None: 10661 VmPlacementPolicyWriter.write_one(obj.placement_policy, writer, 'placement_policy') 10662 if obj.rng_device is not None: 10663 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10664 if obj.serial_number is not None: 10665 SerialNumberWriter.write_one(obj.serial_number, writer, 'serial_number') 10666 if obj.small_icon is not None: 10667 IconWriter.write_one(obj.small_icon, writer, 'small_icon') 10668 if obj.soundcard_enabled is not None: 10669 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10670 if obj.sso is not None: 10671 SsoWriter.write_one(obj.sso, writer, 'sso') 10672 if obj.start_paused is not None: 10673 Writer.write_boolean(writer, 'start_paused', obj.start_paused) 10674 if obj.stateless is not None: 10675 Writer.write_boolean(writer, 'stateless', obj.stateless) 10676 if obj.storage_error_resume_behaviour is not None: 10677 Writer.write_string(writer, 'storage_error_resume_behaviour', obj.storage_error_resume_behaviour.value) 10678 if obj.time_zone is not None: 10679 TimeZoneWriter.write_one(obj.time_zone, writer, 'time_zone') 10680 if obj.tpm_enabled is not None: 10681 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10682 if obj.tunnel_migration is not None: 10683 Writer.write_boolean(writer, 'tunnel_migration', obj.tunnel_migration) 10684 if obj.type is not None: 10685 Writer.write_string(writer, 'type', obj.type.value) 10686 if obj.usb is not None: 10687 UsbWriter.write_one(obj.usb, writer, 'usb') 10688 if obj.virtio_scsi is not None: 10689 VirtioScsiWriter.write_one(obj.virtio_scsi, writer, 'virtio_scsi') 10690 if obj.virtio_scsi_multi_queues is not None: 10691 Writer.write_integer(writer, 'virtio_scsi_multi_queues', obj.virtio_scsi_multi_queues) 10692 if obj.virtio_scsi_multi_queues_enabled is not None: 10693 Writer.write_boolean(writer, 'virtio_scsi_multi_queues_enabled', obj.virtio_scsi_multi_queues_enabled) 10694 if obj.cluster is not None: 10695 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10696 if obj.cpu_profile is not None: 10697 CpuProfileWriter.write_one(obj.cpu_profile, writer, 'cpu_profile') 10698 if obj.quota is not None: 10699 QuotaWriter.write_one(obj.quota, writer, 'quota') 10700 if obj.storage_domain is not None: 10701 StorageDomainWriter.write_one(obj.storage_domain, writer, 'storage_domain') 10702 writer.write_end()
10704 @staticmethod 10705 def write_many(objs, writer, singular=None, plural=None): 10706 if singular is None: 10707 singular = 'vm_base' 10708 if plural is None: 10709 plural = 'vm_bases' 10710 writer.write_start(plural) 10711 if isinstance(objs, List): 10712 href = objs.href 10713 if href is not None: 10714 writer.write_attribute('href', href) 10715 for obj in objs: 10716 VmBaseWriter.write_one(obj, writer, singular) 10717 writer.write_end()
10720class VmMediatedDeviceWriter(Writer): 10721 10722 def __init__(self): 10723 super(VmMediatedDeviceWriter, self).__init__() 10724 10725 @staticmethod 10726 def write_one(obj, writer, singular=None): 10727 if singular is None: 10728 singular = 'vm_mediated_device' 10729 writer.write_start(singular) 10730 href = obj.href 10731 if href is not None: 10732 writer.write_attribute('href', href) 10733 if obj.id is not None: 10734 writer.write_attribute('id', obj.id) 10735 if obj.comment is not None: 10736 Writer.write_string(writer, 'comment', obj.comment) 10737 if obj.description is not None: 10738 Writer.write_string(writer, 'description', obj.description) 10739 if obj.name is not None: 10740 Writer.write_string(writer, 'name', obj.name) 10741 if obj.spec_params is not None: 10742 PropertyWriter.write_many(obj.spec_params, writer, 'property', 'spec_params') 10743 if obj.instance_type is not None: 10744 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10745 if obj.template is not None: 10746 TemplateWriter.write_one(obj.template, writer, 'template') 10747 if obj.vm is not None: 10748 VmWriter.write_one(obj.vm, writer, 'vm') 10749 if obj.vms is not None: 10750 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 10751 writer.write_end() 10752 10753 @staticmethod 10754 def write_many(objs, writer, singular=None, plural=None): 10755 if singular is None: 10756 singular = 'vm_mediated_device' 10757 if plural is None: 10758 plural = 'vm_mediated_devices' 10759 writer.write_start(plural) 10760 if isinstance(objs, List): 10761 href = objs.href 10762 if href is not None: 10763 writer.write_attribute('href', href) 10764 for obj in objs: 10765 VmMediatedDeviceWriter.write_one(obj, writer, singular) 10766 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10725 @staticmethod 10726 def write_one(obj, writer, singular=None): 10727 if singular is None: 10728 singular = 'vm_mediated_device' 10729 writer.write_start(singular) 10730 href = obj.href 10731 if href is not None: 10732 writer.write_attribute('href', href) 10733 if obj.id is not None: 10734 writer.write_attribute('id', obj.id) 10735 if obj.comment is not None: 10736 Writer.write_string(writer, 'comment', obj.comment) 10737 if obj.description is not None: 10738 Writer.write_string(writer, 'description', obj.description) 10739 if obj.name is not None: 10740 Writer.write_string(writer, 'name', obj.name) 10741 if obj.spec_params is not None: 10742 PropertyWriter.write_many(obj.spec_params, writer, 'property', 'spec_params') 10743 if obj.instance_type is not None: 10744 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10745 if obj.template is not None: 10746 TemplateWriter.write_one(obj.template, writer, 'template') 10747 if obj.vm is not None: 10748 VmWriter.write_one(obj.vm, writer, 'vm') 10749 if obj.vms is not None: 10750 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 10751 writer.write_end()
10753 @staticmethod 10754 def write_many(objs, writer, singular=None, plural=None): 10755 if singular is None: 10756 singular = 'vm_mediated_device' 10757 if plural is None: 10758 plural = 'vm_mediated_devices' 10759 writer.write_start(plural) 10760 if isinstance(objs, List): 10761 href = objs.href 10762 if href is not None: 10763 writer.write_attribute('href', href) 10764 for obj in objs: 10765 VmMediatedDeviceWriter.write_one(obj, writer, singular) 10766 writer.write_end()
10769class VmPlacementPolicyWriter(Writer): 10770 10771 def __init__(self): 10772 super(VmPlacementPolicyWriter, self).__init__() 10773 10774 @staticmethod 10775 def write_one(obj, writer, singular=None): 10776 if singular is None: 10777 singular = 'vm_placement_policy' 10778 writer.write_start(singular) 10779 href = obj.href 10780 if href is not None: 10781 writer.write_attribute('href', href) 10782 if obj.affinity is not None: 10783 Writer.write_string(writer, 'affinity', obj.affinity.value) 10784 if obj.hosts is not None: 10785 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 10786 writer.write_end() 10787 10788 @staticmethod 10789 def write_many(objs, writer, singular=None, plural=None): 10790 if singular is None: 10791 singular = 'vm_placement_policy' 10792 if plural is None: 10793 plural = 'vm_placement_policies' 10794 writer.write_start(plural) 10795 if isinstance(objs, List): 10796 href = objs.href 10797 if href is not None: 10798 writer.write_attribute('href', href) 10799 for obj in objs: 10800 VmPlacementPolicyWriter.write_one(obj, writer, singular) 10801 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10774 @staticmethod 10775 def write_one(obj, writer, singular=None): 10776 if singular is None: 10777 singular = 'vm_placement_policy' 10778 writer.write_start(singular) 10779 href = obj.href 10780 if href is not None: 10781 writer.write_attribute('href', href) 10782 if obj.affinity is not None: 10783 Writer.write_string(writer, 'affinity', obj.affinity.value) 10784 if obj.hosts is not None: 10785 HostWriter.write_many(obj.hosts, writer, 'host', 'hosts') 10786 writer.write_end()
10788 @staticmethod 10789 def write_many(objs, writer, singular=None, plural=None): 10790 if singular is None: 10791 singular = 'vm_placement_policy' 10792 if plural is None: 10793 plural = 'vm_placement_policies' 10794 writer.write_start(plural) 10795 if isinstance(objs, List): 10796 href = objs.href 10797 if href is not None: 10798 writer.write_attribute('href', href) 10799 for obj in objs: 10800 VmPlacementPolicyWriter.write_one(obj, writer, singular) 10801 writer.write_end()
10804class VmPoolWriter(Writer): 10805 10806 def __init__(self): 10807 super(VmPoolWriter, self).__init__() 10808 10809 @staticmethod 10810 def write_one(obj, writer, singular=None): 10811 if singular is None: 10812 singular = 'vm_pool' 10813 writer.write_start(singular) 10814 href = obj.href 10815 if href is not None: 10816 writer.write_attribute('href', href) 10817 if obj.id is not None: 10818 writer.write_attribute('id', obj.id) 10819 if obj.auto_storage_select is not None: 10820 Writer.write_boolean(writer, 'auto_storage_select', obj.auto_storage_select) 10821 if obj.comment is not None: 10822 Writer.write_string(writer, 'comment', obj.comment) 10823 if obj.description is not None: 10824 Writer.write_string(writer, 'description', obj.description) 10825 if obj.display is not None: 10826 DisplayWriter.write_one(obj.display, writer, 'display') 10827 if obj.max_user_vms is not None: 10828 Writer.write_integer(writer, 'max_user_vms', obj.max_user_vms) 10829 if obj.name is not None: 10830 Writer.write_string(writer, 'name', obj.name) 10831 if obj.prestarted_vms is not None: 10832 Writer.write_integer(writer, 'prestarted_vms', obj.prestarted_vms) 10833 if obj.rng_device is not None: 10834 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10835 if obj.size is not None: 10836 Writer.write_integer(writer, 'size', obj.size) 10837 if obj.soundcard_enabled is not None: 10838 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10839 if obj.stateful is not None: 10840 Writer.write_boolean(writer, 'stateful', obj.stateful) 10841 if obj.tpm_enabled is not None: 10842 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10843 if obj.type is not None: 10844 Writer.write_string(writer, 'type', obj.type.value) 10845 if obj.use_latest_template_version is not None: 10846 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 10847 if obj.cluster is not None: 10848 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10849 if obj.instance_type is not None: 10850 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10851 if obj.permissions is not None: 10852 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10853 if obj.template is not None: 10854 TemplateWriter.write_one(obj.template, writer, 'template') 10855 if obj.vm is not None: 10856 VmWriter.write_one(obj.vm, writer, 'vm') 10857 writer.write_end() 10858 10859 @staticmethod 10860 def write_many(objs, writer, singular=None, plural=None): 10861 if singular is None: 10862 singular = 'vm_pool' 10863 if plural is None: 10864 plural = 'vm_pools' 10865 writer.write_start(plural) 10866 if isinstance(objs, List): 10867 href = objs.href 10868 if href is not None: 10869 writer.write_attribute('href', href) 10870 for obj in objs: 10871 VmPoolWriter.write_one(obj, writer, singular) 10872 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10809 @staticmethod 10810 def write_one(obj, writer, singular=None): 10811 if singular is None: 10812 singular = 'vm_pool' 10813 writer.write_start(singular) 10814 href = obj.href 10815 if href is not None: 10816 writer.write_attribute('href', href) 10817 if obj.id is not None: 10818 writer.write_attribute('id', obj.id) 10819 if obj.auto_storage_select is not None: 10820 Writer.write_boolean(writer, 'auto_storage_select', obj.auto_storage_select) 10821 if obj.comment is not None: 10822 Writer.write_string(writer, 'comment', obj.comment) 10823 if obj.description is not None: 10824 Writer.write_string(writer, 'description', obj.description) 10825 if obj.display is not None: 10826 DisplayWriter.write_one(obj.display, writer, 'display') 10827 if obj.max_user_vms is not None: 10828 Writer.write_integer(writer, 'max_user_vms', obj.max_user_vms) 10829 if obj.name is not None: 10830 Writer.write_string(writer, 'name', obj.name) 10831 if obj.prestarted_vms is not None: 10832 Writer.write_integer(writer, 'prestarted_vms', obj.prestarted_vms) 10833 if obj.rng_device is not None: 10834 RngDeviceWriter.write_one(obj.rng_device, writer, 'rng_device') 10835 if obj.size is not None: 10836 Writer.write_integer(writer, 'size', obj.size) 10837 if obj.soundcard_enabled is not None: 10838 Writer.write_boolean(writer, 'soundcard_enabled', obj.soundcard_enabled) 10839 if obj.stateful is not None: 10840 Writer.write_boolean(writer, 'stateful', obj.stateful) 10841 if obj.tpm_enabled is not None: 10842 Writer.write_boolean(writer, 'tpm_enabled', obj.tpm_enabled) 10843 if obj.type is not None: 10844 Writer.write_string(writer, 'type', obj.type.value) 10845 if obj.use_latest_template_version is not None: 10846 Writer.write_boolean(writer, 'use_latest_template_version', obj.use_latest_template_version) 10847 if obj.cluster is not None: 10848 ClusterWriter.write_one(obj.cluster, writer, 'cluster') 10849 if obj.instance_type is not None: 10850 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 10851 if obj.permissions is not None: 10852 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10853 if obj.template is not None: 10854 TemplateWriter.write_one(obj.template, writer, 'template') 10855 if obj.vm is not None: 10856 VmWriter.write_one(obj.vm, writer, 'vm') 10857 writer.write_end()
10859 @staticmethod 10860 def write_many(objs, writer, singular=None, plural=None): 10861 if singular is None: 10862 singular = 'vm_pool' 10863 if plural is None: 10864 plural = 'vm_pools' 10865 writer.write_start(plural) 10866 if isinstance(objs, List): 10867 href = objs.href 10868 if href is not None: 10869 writer.write_attribute('href', href) 10870 for obj in objs: 10871 VmPoolWriter.write_one(obj, writer, singular) 10872 writer.write_end()
10875class VmSummaryWriter(Writer): 10876 10877 def __init__(self): 10878 super(VmSummaryWriter, self).__init__() 10879 10880 @staticmethod 10881 def write_one(obj, writer, singular=None): 10882 if singular is None: 10883 singular = 'vm_summary' 10884 writer.write_start(singular) 10885 href = obj.href 10886 if href is not None: 10887 writer.write_attribute('href', href) 10888 if obj.active is not None: 10889 Writer.write_integer(writer, 'active', obj.active) 10890 if obj.migrating is not None: 10891 Writer.write_integer(writer, 'migrating', obj.migrating) 10892 if obj.total is not None: 10893 Writer.write_integer(writer, 'total', obj.total) 10894 writer.write_end() 10895 10896 @staticmethod 10897 def write_many(objs, writer, singular=None, plural=None): 10898 if singular is None: 10899 singular = 'vm_summary' 10900 if plural is None: 10901 plural = 'vm_summaries' 10902 writer.write_start(plural) 10903 if isinstance(objs, List): 10904 href = objs.href 10905 if href is not None: 10906 writer.write_attribute('href', href) 10907 for obj in objs: 10908 VmSummaryWriter.write_one(obj, writer, singular) 10909 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10880 @staticmethod 10881 def write_one(obj, writer, singular=None): 10882 if singular is None: 10883 singular = 'vm_summary' 10884 writer.write_start(singular) 10885 href = obj.href 10886 if href is not None: 10887 writer.write_attribute('href', href) 10888 if obj.active is not None: 10889 Writer.write_integer(writer, 'active', obj.active) 10890 if obj.migrating is not None: 10891 Writer.write_integer(writer, 'migrating', obj.migrating) 10892 if obj.total is not None: 10893 Writer.write_integer(writer, 'total', obj.total) 10894 writer.write_end()
10896 @staticmethod 10897 def write_many(objs, writer, singular=None, plural=None): 10898 if singular is None: 10899 singular = 'vm_summary' 10900 if plural is None: 10901 plural = 'vm_summaries' 10902 writer.write_start(plural) 10903 if isinstance(objs, List): 10904 href = objs.href 10905 if href is not None: 10906 writer.write_attribute('href', href) 10907 for obj in objs: 10908 VmSummaryWriter.write_one(obj, writer, singular) 10909 writer.write_end()
10912class VnicPassThroughWriter(Writer): 10913 10914 def __init__(self): 10915 super(VnicPassThroughWriter, self).__init__() 10916 10917 @staticmethod 10918 def write_one(obj, writer, singular=None): 10919 if singular is None: 10920 singular = 'vnic_pass_through' 10921 writer.write_start(singular) 10922 href = obj.href 10923 if href is not None: 10924 writer.write_attribute('href', href) 10925 if obj.mode is not None: 10926 Writer.write_string(writer, 'mode', obj.mode.value) 10927 writer.write_end() 10928 10929 @staticmethod 10930 def write_many(objs, writer, singular=None, plural=None): 10931 if singular is None: 10932 singular = 'vnic_pass_through' 10933 if plural is None: 10934 plural = 'vnic_pass_throughs' 10935 writer.write_start(plural) 10936 if isinstance(objs, List): 10937 href = objs.href 10938 if href is not None: 10939 writer.write_attribute('href', href) 10940 for obj in objs: 10941 VnicPassThroughWriter.write_one(obj, writer, singular) 10942 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10917 @staticmethod 10918 def write_one(obj, writer, singular=None): 10919 if singular is None: 10920 singular = 'vnic_pass_through' 10921 writer.write_start(singular) 10922 href = obj.href 10923 if href is not None: 10924 writer.write_attribute('href', href) 10925 if obj.mode is not None: 10926 Writer.write_string(writer, 'mode', obj.mode.value) 10927 writer.write_end()
10929 @staticmethod 10930 def write_many(objs, writer, singular=None, plural=None): 10931 if singular is None: 10932 singular = 'vnic_pass_through' 10933 if plural is None: 10934 plural = 'vnic_pass_throughs' 10935 writer.write_start(plural) 10936 if isinstance(objs, List): 10937 href = objs.href 10938 if href is not None: 10939 writer.write_attribute('href', href) 10940 for obj in objs: 10941 VnicPassThroughWriter.write_one(obj, writer, singular) 10942 writer.write_end()
10945class VnicProfileWriter(Writer): 10946 10947 def __init__(self): 10948 super(VnicProfileWriter, self).__init__() 10949 10950 @staticmethod 10951 def write_one(obj, writer, singular=None): 10952 if singular is None: 10953 singular = 'vnic_profile' 10954 writer.write_start(singular) 10955 href = obj.href 10956 if href is not None: 10957 writer.write_attribute('href', href) 10958 if obj.id is not None: 10959 writer.write_attribute('id', obj.id) 10960 if obj.comment is not None: 10961 Writer.write_string(writer, 'comment', obj.comment) 10962 if obj.custom_properties is not None: 10963 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10964 if obj.description is not None: 10965 Writer.write_string(writer, 'description', obj.description) 10966 if obj.migratable is not None: 10967 Writer.write_boolean(writer, 'migratable', obj.migratable) 10968 if obj.name is not None: 10969 Writer.write_string(writer, 'name', obj.name) 10970 if obj.pass_through is not None: 10971 VnicPassThroughWriter.write_one(obj.pass_through, writer, 'pass_through') 10972 if obj.port_mirroring is not None: 10973 Writer.write_boolean(writer, 'port_mirroring', obj.port_mirroring) 10974 if obj.failover is not None: 10975 VnicProfileWriter.write_one(obj.failover, writer, 'failover') 10976 if obj.network is not None: 10977 NetworkWriter.write_one(obj.network, writer, 'network') 10978 if obj.network_filter is not None: 10979 NetworkFilterWriter.write_one(obj.network_filter, writer, 'network_filter') 10980 if obj.permissions is not None: 10981 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10982 if obj.qos is not None: 10983 QosWriter.write_one(obj.qos, writer, 'qos') 10984 writer.write_end() 10985 10986 @staticmethod 10987 def write_many(objs, writer, singular=None, plural=None): 10988 if singular is None: 10989 singular = 'vnic_profile' 10990 if plural is None: 10991 plural = 'vnic_profiles' 10992 writer.write_start(plural) 10993 if isinstance(objs, List): 10994 href = objs.href 10995 if href is not None: 10996 writer.write_attribute('href', href) 10997 for obj in objs: 10998 VnicProfileWriter.write_one(obj, writer, singular) 10999 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
10950 @staticmethod 10951 def write_one(obj, writer, singular=None): 10952 if singular is None: 10953 singular = 'vnic_profile' 10954 writer.write_start(singular) 10955 href = obj.href 10956 if href is not None: 10957 writer.write_attribute('href', href) 10958 if obj.id is not None: 10959 writer.write_attribute('id', obj.id) 10960 if obj.comment is not None: 10961 Writer.write_string(writer, 'comment', obj.comment) 10962 if obj.custom_properties is not None: 10963 CustomPropertyWriter.write_many(obj.custom_properties, writer, 'custom_property', 'custom_properties') 10964 if obj.description is not None: 10965 Writer.write_string(writer, 'description', obj.description) 10966 if obj.migratable is not None: 10967 Writer.write_boolean(writer, 'migratable', obj.migratable) 10968 if obj.name is not None: 10969 Writer.write_string(writer, 'name', obj.name) 10970 if obj.pass_through is not None: 10971 VnicPassThroughWriter.write_one(obj.pass_through, writer, 'pass_through') 10972 if obj.port_mirroring is not None: 10973 Writer.write_boolean(writer, 'port_mirroring', obj.port_mirroring) 10974 if obj.failover is not None: 10975 VnicProfileWriter.write_one(obj.failover, writer, 'failover') 10976 if obj.network is not None: 10977 NetworkWriter.write_one(obj.network, writer, 'network') 10978 if obj.network_filter is not None: 10979 NetworkFilterWriter.write_one(obj.network_filter, writer, 'network_filter') 10980 if obj.permissions is not None: 10981 PermissionWriter.write_many(obj.permissions, writer, 'permission', 'permissions') 10982 if obj.qos is not None: 10983 QosWriter.write_one(obj.qos, writer, 'qos') 10984 writer.write_end()
10986 @staticmethod 10987 def write_many(objs, writer, singular=None, plural=None): 10988 if singular is None: 10989 singular = 'vnic_profile' 10990 if plural is None: 10991 plural = 'vnic_profiles' 10992 writer.write_start(plural) 10993 if isinstance(objs, List): 10994 href = objs.href 10995 if href is not None: 10996 writer.write_attribute('href', href) 10997 for obj in objs: 10998 VnicProfileWriter.write_one(obj, writer, singular) 10999 writer.write_end()
11002class VnicProfileMappingWriter(Writer): 11003 11004 def __init__(self): 11005 super(VnicProfileMappingWriter, self).__init__() 11006 11007 @staticmethod 11008 def write_one(obj, writer, singular=None): 11009 if singular is None: 11010 singular = 'vnic_profile_mapping' 11011 writer.write_start(singular) 11012 href = obj.href 11013 if href is not None: 11014 writer.write_attribute('href', href) 11015 if obj.source_network_name is not None: 11016 Writer.write_string(writer, 'source_network_name', obj.source_network_name) 11017 if obj.source_network_profile_name is not None: 11018 Writer.write_string(writer, 'source_network_profile_name', obj.source_network_profile_name) 11019 if obj.target_vnic_profile is not None: 11020 VnicProfileWriter.write_one(obj.target_vnic_profile, writer, 'target_vnic_profile') 11021 writer.write_end() 11022 11023 @staticmethod 11024 def write_many(objs, writer, singular=None, plural=None): 11025 if singular is None: 11026 singular = 'vnic_profile_mapping' 11027 if plural is None: 11028 plural = 'vnic_profile_mappings' 11029 writer.write_start(plural) 11030 if isinstance(objs, List): 11031 href = objs.href 11032 if href is not None: 11033 writer.write_attribute('href', href) 11034 for obj in objs: 11035 VnicProfileMappingWriter.write_one(obj, writer, singular) 11036 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
11007 @staticmethod 11008 def write_one(obj, writer, singular=None): 11009 if singular is None: 11010 singular = 'vnic_profile_mapping' 11011 writer.write_start(singular) 11012 href = obj.href 11013 if href is not None: 11014 writer.write_attribute('href', href) 11015 if obj.source_network_name is not None: 11016 Writer.write_string(writer, 'source_network_name', obj.source_network_name) 11017 if obj.source_network_profile_name is not None: 11018 Writer.write_string(writer, 'source_network_profile_name', obj.source_network_profile_name) 11019 if obj.target_vnic_profile is not None: 11020 VnicProfileWriter.write_one(obj.target_vnic_profile, writer, 'target_vnic_profile') 11021 writer.write_end()
11023 @staticmethod 11024 def write_many(objs, writer, singular=None, plural=None): 11025 if singular is None: 11026 singular = 'vnic_profile_mapping' 11027 if plural is None: 11028 plural = 'vnic_profile_mappings' 11029 writer.write_start(plural) 11030 if isinstance(objs, List): 11031 href = objs.href 11032 if href is not None: 11033 writer.write_attribute('href', href) 11034 for obj in objs: 11035 VnicProfileMappingWriter.write_one(obj, writer, singular) 11036 writer.write_end()
11039class VolumeGroupWriter(Writer): 11040 11041 def __init__(self): 11042 super(VolumeGroupWriter, self).__init__() 11043 11044 @staticmethod 11045 def write_one(obj, writer, singular=None): 11046 if singular is None: 11047 singular = 'volume_group' 11048 writer.write_start(singular) 11049 href = obj.href 11050 if href is not None: 11051 writer.write_attribute('href', href) 11052 if obj.id is not None: 11053 writer.write_attribute('id', obj.id) 11054 if obj.logical_units is not None: 11055 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 11056 if obj.name is not None: 11057 Writer.write_string(writer, 'name', obj.name) 11058 writer.write_end() 11059 11060 @staticmethod 11061 def write_many(objs, writer, singular=None, plural=None): 11062 if singular is None: 11063 singular = 'volume_group' 11064 if plural is None: 11065 plural = 'volume_groups' 11066 writer.write_start(plural) 11067 if isinstance(objs, List): 11068 href = objs.href 11069 if href is not None: 11070 writer.write_attribute('href', href) 11071 for obj in objs: 11072 VolumeGroupWriter.write_one(obj, writer, singular) 11073 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
11044 @staticmethod 11045 def write_one(obj, writer, singular=None): 11046 if singular is None: 11047 singular = 'volume_group' 11048 writer.write_start(singular) 11049 href = obj.href 11050 if href is not None: 11051 writer.write_attribute('href', href) 11052 if obj.id is not None: 11053 writer.write_attribute('id', obj.id) 11054 if obj.logical_units is not None: 11055 LogicalUnitWriter.write_many(obj.logical_units, writer, 'logical_unit', 'logical_units') 11056 if obj.name is not None: 11057 Writer.write_string(writer, 'name', obj.name) 11058 writer.write_end()
11060 @staticmethod 11061 def write_many(objs, writer, singular=None, plural=None): 11062 if singular is None: 11063 singular = 'volume_group' 11064 if plural is None: 11065 plural = 'volume_groups' 11066 writer.write_start(plural) 11067 if isinstance(objs, List): 11068 href = objs.href 11069 if href is not None: 11070 writer.write_attribute('href', href) 11071 for obj in objs: 11072 VolumeGroupWriter.write_one(obj, writer, singular) 11073 writer.write_end()
11076class WatchdogWriter(Writer): 11077 11078 def __init__(self): 11079 super(WatchdogWriter, self).__init__() 11080 11081 @staticmethod 11082 def write_one(obj, writer, singular=None): 11083 if singular is None: 11084 singular = 'watchdog' 11085 writer.write_start(singular) 11086 href = obj.href 11087 if href is not None: 11088 writer.write_attribute('href', href) 11089 if obj.id is not None: 11090 writer.write_attribute('id', obj.id) 11091 if obj.action is not None: 11092 Writer.write_string(writer, 'action', obj.action.value) 11093 if obj.comment is not None: 11094 Writer.write_string(writer, 'comment', obj.comment) 11095 if obj.description is not None: 11096 Writer.write_string(writer, 'description', obj.description) 11097 if obj.model is not None: 11098 Writer.write_string(writer, 'model', obj.model.value) 11099 if obj.name is not None: 11100 Writer.write_string(writer, 'name', obj.name) 11101 if obj.instance_type is not None: 11102 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 11103 if obj.template is not None: 11104 TemplateWriter.write_one(obj.template, writer, 'template') 11105 if obj.vm is not None: 11106 VmWriter.write_one(obj.vm, writer, 'vm') 11107 if obj.vms is not None: 11108 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 11109 writer.write_end() 11110 11111 @staticmethod 11112 def write_many(objs, writer, singular=None, plural=None): 11113 if singular is None: 11114 singular = 'watchdog' 11115 if plural is None: 11116 plural = 'watchdogs' 11117 writer.write_start(plural) 11118 if isinstance(objs, List): 11119 href = objs.href 11120 if href is not None: 11121 writer.write_attribute('href', href) 11122 for obj in objs: 11123 WatchdogWriter.write_one(obj, writer, singular) 11124 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
11081 @staticmethod 11082 def write_one(obj, writer, singular=None): 11083 if singular is None: 11084 singular = 'watchdog' 11085 writer.write_start(singular) 11086 href = obj.href 11087 if href is not None: 11088 writer.write_attribute('href', href) 11089 if obj.id is not None: 11090 writer.write_attribute('id', obj.id) 11091 if obj.action is not None: 11092 Writer.write_string(writer, 'action', obj.action.value) 11093 if obj.comment is not None: 11094 Writer.write_string(writer, 'comment', obj.comment) 11095 if obj.description is not None: 11096 Writer.write_string(writer, 'description', obj.description) 11097 if obj.model is not None: 11098 Writer.write_string(writer, 'model', obj.model.value) 11099 if obj.name is not None: 11100 Writer.write_string(writer, 'name', obj.name) 11101 if obj.instance_type is not None: 11102 InstanceTypeWriter.write_one(obj.instance_type, writer, 'instance_type') 11103 if obj.template is not None: 11104 TemplateWriter.write_one(obj.template, writer, 'template') 11105 if obj.vm is not None: 11106 VmWriter.write_one(obj.vm, writer, 'vm') 11107 if obj.vms is not None: 11108 VmWriter.write_many(obj.vms, writer, 'vm', 'vms') 11109 writer.write_end()
11111 @staticmethod 11112 def write_many(objs, writer, singular=None, plural=None): 11113 if singular is None: 11114 singular = 'watchdog' 11115 if plural is None: 11116 plural = 'watchdogs' 11117 writer.write_start(plural) 11118 if isinstance(objs, List): 11119 href = objs.href 11120 if href is not None: 11121 writer.write_attribute('href', href) 11122 for obj in objs: 11123 WatchdogWriter.write_one(obj, writer, singular) 11124 writer.write_end()
11127class WeightWriter(Writer): 11128 11129 def __init__(self): 11130 super(WeightWriter, self).__init__() 11131 11132 @staticmethod 11133 def write_one(obj, writer, singular=None): 11134 if singular is None: 11135 singular = 'weight' 11136 writer.write_start(singular) 11137 href = obj.href 11138 if href is not None: 11139 writer.write_attribute('href', href) 11140 if obj.id is not None: 11141 writer.write_attribute('id', obj.id) 11142 if obj.comment is not None: 11143 Writer.write_string(writer, 'comment', obj.comment) 11144 if obj.description is not None: 11145 Writer.write_string(writer, 'description', obj.description) 11146 if obj.factor is not None: 11147 Writer.write_integer(writer, 'factor', obj.factor) 11148 if obj.name is not None: 11149 Writer.write_string(writer, 'name', obj.name) 11150 if obj.scheduling_policy is not None: 11151 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 11152 if obj.scheduling_policy_unit is not None: 11153 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 11154 writer.write_end() 11155 11156 @staticmethod 11157 def write_many(objs, writer, singular=None, plural=None): 11158 if singular is None: 11159 singular = 'weight' 11160 if plural is None: 11161 plural = 'weights' 11162 writer.write_start(plural) 11163 if isinstance(objs, List): 11164 href = objs.href 11165 if href is not None: 11166 writer.write_attribute('href', href) 11167 for obj in objs: 11168 WeightWriter.write_one(obj, writer, singular) 11169 writer.write_end()
This is the base class for all the writers of the SDK. It contains the utility methods used by all of them.
11132 @staticmethod 11133 def write_one(obj, writer, singular=None): 11134 if singular is None: 11135 singular = 'weight' 11136 writer.write_start(singular) 11137 href = obj.href 11138 if href is not None: 11139 writer.write_attribute('href', href) 11140 if obj.id is not None: 11141 writer.write_attribute('id', obj.id) 11142 if obj.comment is not None: 11143 Writer.write_string(writer, 'comment', obj.comment) 11144 if obj.description is not None: 11145 Writer.write_string(writer, 'description', obj.description) 11146 if obj.factor is not None: 11147 Writer.write_integer(writer, 'factor', obj.factor) 11148 if obj.name is not None: 11149 Writer.write_string(writer, 'name', obj.name) 11150 if obj.scheduling_policy is not None: 11151 SchedulingPolicyWriter.write_one(obj.scheduling_policy, writer, 'scheduling_policy') 11152 if obj.scheduling_policy_unit is not None: 11153 SchedulingPolicyUnitWriter.write_one(obj.scheduling_policy_unit, writer, 'scheduling_policy_unit') 11154 writer.write_end()
11156 @staticmethod 11157 def write_many(objs, writer, singular=None, plural=None): 11158 if singular is None: 11159 singular = 'weight' 11160 if plural is None: 11161 plural = 'weights' 11162 writer.write_start(plural) 11163 if isinstance(objs, List): 11164 href = objs.href 11165 if href is not None: 11166 writer.write_attribute('href', href) 11167 for obj in objs: 11168 WeightWriter.write_one(obj, writer, singular) 11169 writer.write_end()